[jmeter] branch master updated: Round deadline to upper second in our race against the flaky test
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new c659da2 Round deadline to upper second in our race against the flaky test c659da2 is described below commit c659da2290afdfd8ecfe586af0e23d5b2f53294a Author: Felix Schumacher AuthorDate: Tue Sep 1 21:07:45 2020 +0200 Round deadline to upper second in our race against the flaky test --- .../org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java index d35456c..1c9f358 100644 --- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java +++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java @@ -86,7 +86,8 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { protected abstract void setRequestHeaders(); protected void sleepTill(long deadline) { -while (System.currentTimeMillis() < deadline) { +long roundedToUpperSecond = Math.round(Math.ceil(deadline / 1000.0)) * 1000; +while (System.currentTimeMillis() < roundedToUpperSecond) { try { Thread.sleep(100); } catch (InterruptedException e) {
[jmeter] branch master updated: Add the debug info in the right assert method
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new d84c9e2 Add the debug info in the right assert method d84c9e2 is described below commit d84c9e2258caacb46f7c3796ae4377ccde1be36f Author: Felix Schumacher AuthorDate: Tue Sep 1 20:54:30 2020 +0200 Add the debug info in the right assert method --- .../apache/jmeter/protocol/http/control/TestCacheManagerBase.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java index 51f1182..d35456c 100644 --- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java +++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java @@ -335,8 +335,9 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { } private void assertInvalidEntry() throws Exception { +CacheEntry cachedEntry = getThreadCacheEntry(LOCAL_HOST); assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); +assertFalse(this.cacheManager.inCache(url), "Should not find valid entry. Found: " + cachedEntry + " at " + System.currentTimeMillis()); } private void assertValidEntry() throws Exception { @@ -345,9 +346,8 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { } private void assertNoSuchEntry() throws Exception { -CacheEntry cachedEntry = getThreadCacheEntry(LOCAL_HOST); -assertNull(cachedEntry, "Should not find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry. Found: " + cachedEntry + " at " + System.currentTimeMillis()); +assertNull(getThreadCacheEntry(LOCAL_HOST), "Should not find entry"); +assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); } @Test
[jmeter] branch master updated: Comply to JLS and reorder modifiers
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new b4024a0 Comply to JLS and reorder modifiers b4024a0 is described below commit b4024a0bfd03ce933dc1a116c9aac62219abaf46 Author: Felix Schumacher AuthorDate: Tue Sep 1 20:45:32 2020 +0200 Comply to JLS and reorder modifiers --- .../org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/src/main/java/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java b/src/components/src/main/java/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java index dba9d6c..b3634dc 100644 --- a/src/components/src/main/java/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java +++ b/src/components/src/main/java/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java @@ -148,7 +148,7 @@ public abstract class AbstractRandomTimerGui extends AbstractTimerGui { * {@inheritDoc} */ @Override -abstract public String getLabelResource(); +public abstract String getLabelResource(); /** * Create implementation of RandomTimer @@ -159,20 +159,20 @@ public abstract class AbstractRandomTimerGui extends AbstractTimerGui { /** * @return String timer delay label key */ -abstract protected String getTimerDelayLabelKey(); +protected abstract String getTimerDelayLabelKey(); /** * @return String timer range label key */ -abstract protected String getTimerRangeLabelKey(); +protected abstract String getTimerRangeLabelKey(); /** * @return String default delay value */ -abstract protected String getDefaultDelay(); +protected abstract String getDefaultDelay(); /** * @return String default range value */ -abstract protected String getDefaultRange(); +protected abstract String getDefaultRange(); }
[jmeter] branch master updated: Extract common logic and add debug info for flaky tests
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new 1ba8069 Extract common logic and add debug info for flaky tests 1ba8069 is described below commit 1ba80694cf688ce1a2d2edd0877acc1a7f7f7f4e Author: Felix Schumacher AuthorDate: Tue Sep 1 20:29:20 2020 +0200 Extract common logic and add debug info for flaky tests --- .../http/control/TestCacheManagerBase.java | 113 + 1 file changed, 46 insertions(+), 67 deletions(-) diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java index 8964fdb..51f1182 100644 --- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java +++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java @@ -101,63 +101,50 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { public void testExpiresBug59962() throws Exception { this.cacheManager.setUseExpires(true); this.cacheManager.testIterationStart(null); -assertNull(getThreadCacheEntry(LOCAL_HOST), "Should not find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); +assertNoSuchEntry(); long start = System.currentTimeMillis(); setExpires(makeDate(new Date(start + 2000))); cacheResultWithGivenCode("304"); -assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); -assertTrue(this.cacheManager.inCache(url), "Should find valid entry"); +assertValidEntry(); sleepTill(start + 2010); -assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); +assertInvalidEntry(); } @Test public void testExpires() throws Exception { this.cacheManager.setUseExpires(true); this.cacheManager.testIterationStart(null); -assertNull(getThreadCacheEntry(LOCAL_HOST), "Should not find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); +assertNoSuchEntry(); long start = System.currentTimeMillis(); setExpires(makeDate(new Date(start + 2000))); cacheResult(sampleResultOK); -assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); -assertTrue(this.cacheManager.inCache(url), "Should find valid entry"); +assertValidEntry(); sleepTill(start + 2010); -assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); +assertInvalidEntry(); } @Test public void testNoExpires() throws Exception { this.cacheManager.setUseExpires(false); this.cacheManager.testIterationStart(null); -assertNull(getThreadCacheEntry(LOCAL_HOST), "Should not find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); +assertNoSuchEntry(); setExpires(makeDate(new Date(System.currentTimeMillis() + 2000))); cacheResult(sampleResultOK); -assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); +assertInvalidEntry(); } @Test public void testCacheControl() throws Exception { this.cacheManager.setUseExpires(true); this.cacheManager.testIterationStart(null); -assertNull(getThreadCacheEntry(LOCAL_HOST), "Should not find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); +assertNoSuchEntry(); long start = System.currentTimeMillis(); setExpires(makeDate(new Date(start))); setCacheControl("public, max-age=1"); cacheResult(sampleResultOK); -assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); -assertTrue(this.cacheManager.inCache(url), "Should find valid entry"); +assertValidEntry(); sleepTill(start + 1010); -CacheEntry cachedEntry = getThreadCacheEntry(LOCAL_HOST); -assertNotNull(cachedEntry, "Should find entry"); -assertFalse(this.cacheManager.inCache(url), -"Should not find valid entry. Found: " + cachedEntry + " at " + System.currentTimeMillis()); +assertInvalidEntry(); } @Test @@ -238,41 +225,34 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { public void testCacheHEAD() throws Exception {
[jmeter] branch master updated: Use try-with-resource to silence sonar and make code simpler
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new b34ba26 Use try-with-resource to silence sonar and make code simpler b34ba26 is described below commit b34ba267bc2262c529ee6b1fa04c50e85fbc065f Author: Felix Schumacher AuthorDate: Tue Sep 1 20:15:30 2020 +0200 Use try-with-resource to silence sonar and make code simpler --- .../java/org/apache/jmeter/util/JMeterUtils.java | 32 +++--- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java b/src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java index 0e350a2..f9de829 100644 --- a/src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java +++ b/src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java @@ -189,15 +189,11 @@ public class JMeterUtils implements UnitTestManager { */ public static void loadJMeterProperties(String file) { Properties p = new Properties(System.getProperties()); -InputStream is = null; -try { -File f = new File(file); -is = new FileInputStream(f); +try (InputStream is = new FileInputStream(new File(file))) { p.load(is); } catch (IOException e) { -try { -is = ClassLoader.getSystemResourceAsStream( -"org/apache/jmeter/jmeter.properties"); // $NON-NLS-1$ +try (InputStream is = ClassLoader.getSystemResourceAsStream( +"org/apache/jmeter/jmeter.properties")) { // $NON-NLS-1$ if (is == null) { throw new RuntimeException("Could not read JMeter properties file:" + file); } @@ -205,8 +201,6 @@ public class JMeterUtils implements UnitTestManager { } catch (IOException ex) { throw new RuntimeException("Could not read JMeter properties file:" + file); } -} finally { -JOrphanUtils.closeQuietly(is); } appProperties = p; } @@ -234,19 +228,15 @@ public class JMeterUtils implements UnitTestManager { */ public static Properties loadProperties(String file, Properties defaultProps) { Properties p = new Properties(defaultProps); -InputStream is = null; -try { -File f = new File(file); -is = new FileInputStream(f); +try (InputStream is = new FileInputStream(new File(file))) { p.load(is); } catch (IOException e) { -try { -final URL resource = JMeterUtils.class.getClassLoader().getResource(file); -if (resource == null) { -log.warn("Cannot find {}", file); -return defaultProps; -} -is = resource.openStream(); +final URL resource = JMeterUtils.class.getClassLoader().getResource(file); +if (resource == null) { +log.warn("Cannot find {}", file); +return defaultProps; +} +try (InputStream is = resource.openStream()) { if (is == null) { log.warn("Cannot open {}", file); return defaultProps; @@ -256,8 +246,6 @@ public class JMeterUtils implements UnitTestManager { log.warn("Error reading {} {}", file, ex.toString()); return defaultProps; } -} finally { -JOrphanUtils.closeQuietly(is); } return p; }
[jmeter] branch master updated: Lower complexity by extracting logic into private methods
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new 5cdcdbd Lower complexity by extracting logic into private methods 5cdcdbd is described below commit 5cdcdbd691660ac6b2aef601ff115db336272f56 Author: Felix Schumacher AuthorDate: Tue Sep 1 19:54:45 2020 +0200 Lower complexity by extracting logic into private methods --- .../apache/jmeter/assertions/SMIMEAssertion.java | 195 - 1 file changed, 111 insertions(+), 84 deletions(-) diff --git a/src/components/src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java b/src/components/src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java index fffcf42..aeebd67 100644 --- a/src/components/src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java +++ b/src/components/src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java @@ -25,6 +25,8 @@ import java.io.InputStream; import java.math.BigInteger; import java.security.GeneralSecurityException; import java.security.Security; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.util.ArrayList; @@ -163,76 +165,16 @@ class SMIMEAssertion { X509CertificateHolder cert = (X509CertificateHolder) certIt.next(); if (testElement.isVerifySignature()) { - -SignerInformationVerifier verifier = null; -try { -verifier = new JcaSimpleSignerInfoVerifierBuilder().setProvider("BC") -.build(cert); -} catch (OperatorCreationException e) { -log.error("Can't create a provider.", e); -} -if (verifier == null || !signer.verify(verifier)) { -res.setFailure(true); -res.setFailureMessage("Signature is invalid"); -} +verifySignature(signer, res, cert); } if (testElement.isSignerCheckConstraints()) { StringBuilder failureMessage = new StringBuilder(); -String serial = testElement.getSignerSerial(); -if (!JOrphanUtils.isBlank(serial)) { -BigInteger serialNbr = readSerialNumber(serial); -if (!serialNbr.equals(cert.getSerialNumber())) { -res.setFailure(true); -failureMessage -.append("Serial number ") -.append(serialNbr) -.append(" does not match serial from signer certificate: ") - .append(cert.getSerialNumber()).append("\n"); -} -} - -String email = testElement.getSignerEmail(); -if (!JOrphanUtils.isBlank(email)) { -List emailFromCert = getEmailFromCert(cert); -if (!emailFromCert.contains(email)) { -res.setFailure(true); -failureMessage -.append("Email address \"") -.append(email) -.append("\" not present in signer certificate\n"); -} - -} - -String subject = testElement.getSignerDn(); -if (subject.length() > 0) { -final X500Name certPrincipal = cert.getSubject(); -log.debug("DN from cert: {}", certPrincipal); -X500Name principal = new X500Name(subject); -log.debug("DN from assertion: {}", principal); -if (!principal.equals(certPrincipal)) { -res.setFailure(true); -failureMessage -.append("Distinguished name of signer certificate does not match \"") -.append(subject).append("\"\n"); -} -} - -String issuer = testElement.getIssuerDn(); -if (issuer.length() > 0) { -final X500Name issuerX500Name = cert.getIssuer(); -
[jmeter] branch master updated: Add generics info, mainly to trigger CI build
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new 17812bd Add generics info, mainly to trigger CI build 17812bd is described below commit 17812bdae607c277c425d0a4a1d1fef7963f7962 Author: Felix Schumacher AuthorDate: Tue Sep 1 19:42:15 2020 +0200 Add generics info, mainly to trigger CI build --- .../src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java b/src/components/src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java index 7851c55..fffcf42 100644 --- a/src/components/src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java +++ b/src/components/src/main/java/org/apache/jmeter/assertions/SMIMEAssertion.java @@ -149,7 +149,7 @@ class SMIMEAssertion { AssertionResult res = new AssertionResult(name); try { -Store certs = s.getCertificates(); +Store certs = s.getCertificates(); SignerInformationStore signers = s.getSignerInfos(); Iterator signerIt = signers.getSigners().iterator();
[jmeter] branch master updated: Allow even more delta and extract it into a constant
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new 07c3983 Allow even more delta and extract it into a constant 07c3983 is described below commit 07c3983352cdb7af6205313ef260c2bd394b9897 Author: Felix Schumacher AuthorDate: Tue Sep 1 19:23:31 2020 +0200 Allow even more delta and extract it into a constant --- .../jmeter/visualizers/backend/SamplerMetricTimedModeTest.java | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java b/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java index 833d36e..4de3a0f 100644 --- a/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java +++ b/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java @@ -29,6 +29,7 @@ import org.junit.jupiter.api.Test; public class SamplerMetricTimedModeTest { private static final int DEFAULT_ELAPSED_TIME = 1_000; +private static final double ALLOWED_DELTA = 25.0; @BeforeEach public void initMode() throws Exception { @@ -111,8 +112,8 @@ public class SamplerMetricTimedModeTest { assertEquals("We are recognized as a TransactionController made sample", Boolean.TRUE, Boolean.valueOf(TransactionController.isFromTransactionController(sample))); metric.addCumulated(sample); -assertEquals("Before reset ok.max", DEFAULT_ELAPSED_TIME, metric.getOkMaxTime(), 2.001); -assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 2.001); +assertEquals("Before reset ok.max", DEFAULT_ELAPSED_TIME, metric.getOkMaxTime(), ALLOWED_DELTA); +assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), ALLOWED_DELTA); assertEquals("Before reset hits", 2, metric.getHits(), 0.0); assertEquals("Before reset sent bytes", 2000, metric.getSentBytes(), 0.0); assertEquals("Before reset received bytes", 4000, metric.getReceivedBytes(), 0.0); @@ -133,8 +134,8 @@ public class SamplerMetricTimedModeTest { assertEquals("We are recognized as a TransactionController made sample", Boolean.TRUE, Boolean.valueOf(TransactionController.isFromTransactionController(sample))); metric.addCumulated(sample); -assertEquals("Before reset ko.max", DEFAULT_ELAPSED_TIME, metric.getKoMaxTime(), 8.001); -assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 8.001); +assertEquals("Before reset ko.max", DEFAULT_ELAPSED_TIME, metric.getKoMaxTime(), ALLOWED_DELTA); +assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), ALLOWED_DELTA); assertEquals("Before reset failures", 1, metric.getFailures(), 0.0); assertEquals("Before reset sent bytes", 2000, metric.getSentBytes(), 0.0); assertEquals("Before reset received bytes", 4000, metric.getReceivedBytes(), 0.0);
[jmeter] branch master updated: Correct typo
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new 0c6a72d Correct typo 0c6a72d is described below commit 0c6a72d3472fffb2c9eccb000cd53e56e25157f8 Author: Felix Schumacher AuthorDate: Tue Sep 1 18:08:02 2020 +0200 Correct typo --- .../org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java index 45b2fac..8964fdb 100644 --- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java +++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java @@ -264,7 +264,7 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { sleepTill(start + 1050); CacheEntry cachedEntry = getThreadCacheEntry(LOCAL_HOST); assertNotNull(cachedEntry, "Should still find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not now find valid entry. Found: " + cachedEntry + " at " + System.currentTimeMillis())); +assertFalse(this.cacheManager.inCache(url), "Should not now find valid entry. Found: " + cachedEntry + " at " + System.currentTimeMillis()); } @Test
[jmeter] branch master updated: Give a bit mor time for flaky test and add debug info
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new 9a7f4e2 Give a bit mor time for flaky test and add debug info 9a7f4e2 is described below commit 9a7f4e2d0394e6ecbee2bb7dac9442613c67ba00 Author: Felix Schumacher AuthorDate: Tue Sep 1 18:02:58 2020 +0200 Give a bit mor time for flaky test and add debug info --- .../apache/jmeter/protocol/http/control/TestCacheManagerBase.java | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java index a7320ac..45b2fac 100644 --- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java +++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java @@ -261,9 +261,10 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { cacheResult(sampleResultOK); assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); assertTrue(this.cacheManager.inCache(url), "Should find valid entry"); -sleepTill(start + 1020); -assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should still find entry"); -assertFalse(this.cacheManager.inCache(url), "Should not now find valid entry"); +sleepTill(start + 1050); +CacheEntry cachedEntry = getThreadCacheEntry(LOCAL_HOST); +assertNotNull(cachedEntry, "Should still find entry"); +assertFalse(this.cacheManager.inCache(url), "Should not now find valid entry. Found: " + cachedEntry + " at " + System.currentTimeMillis())); } @Test
[jmeter] branch master updated: Wait a bit longer at least to the next second to get rid of this flaky test
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new da7a3e4 Wait a bit longer at least to the next second to get rid of this flaky test da7a3e4 is described below commit da7a3e4f42dd4ac4c8680fc79539aa759c4ad156 Author: Felix Schumacher AuthorDate: Tue Sep 1 17:48:59 2020 +0200 Wait a bit longer at least to the next second to get rid of this flaky test --- .../org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java index 16077ab..a7320ac 100644 --- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java +++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerBase.java @@ -283,7 +283,7 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { cacheResult(sampleResultOK); assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); assertTrue(this.cacheManager.inCache(url), "Should find valid entry"); -sleepTill(start + age / 10 + 10); +sleepTill(start + age / 10 + 1010); CacheEntry cachedEntry = getThreadCacheEntry(LOCAL_HOST); assertNotNull(cachedEntry, "Should find entry"); assertFalse(this.cacheManager.inCache(url), @@ -307,7 +307,7 @@ public abstract class TestCacheManagerBase extends JMeterTestCase { cacheResult(sampleResultOK); assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); assertTrue(this.cacheManager.inCache(url), "Should find valid entry"); -sleepTill(start + age / 10 + 10); +sleepTill(start + age / 10 + 1010); assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry"); assertFalse(this.cacheManager.inCache(url), "Should not find valid entry"); }
[jmeter] branch master updated: Be even more friendly to longer hiccups in tests
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new c212593 Be even more friendly to longer hiccups in tests c212593 is described below commit c212593fdeafae59c7921fb82811c6e95a493ea7 Author: Felix Schumacher AuthorDate: Tue Sep 1 15:33:52 2020 +0200 Be even more friendly to longer hiccups in tests --- .../visualizers/backend/SamplerMetricFixedModeTest.java | 16 .../visualizers/backend/SamplerMetricTimedModeTest.java | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricFixedModeTest.java b/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricFixedModeTest.java index f8cb90f..a72958f 100644 --- a/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricFixedModeTest.java +++ b/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricFixedModeTest.java @@ -129,16 +129,16 @@ public class SamplerMetricFixedModeTest { assertEquals("We are recognized as a TransactionController made sample", Boolean.TRUE, Boolean.valueOf(TransactionController.isFromTransactionController(sample))); metric.addCumulated(sample); -assertEquals("Before reset ok.max", DEFAULT_ELAPSED_TIME, metric.getOkMaxTime(), 4.001); -assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 4.001); +assertEquals("Before reset ok.max", DEFAULT_ELAPSED_TIME, metric.getOkMaxTime(), 8.001); +assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 8.001); assertEquals("Before reset hits", 2, metric.getHits(), 0.0); assertEquals("Before reset sent bytes", 2000, metric.getSentBytes(), 0.0); assertEquals("Before reset received bytes", 4000, metric.getReceivedBytes(), 0.0); metric.resetForTimeInterval(); -assertEquals("After reset in TIMED mode ok.max", DEFAULT_ELAPSED_TIME, metric.getOkMaxTime(), 0.0); -assertEquals("After reset in TIMED mode all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 0.0); +assertEquals("After reset in TIMED mode ok.max", DEFAULT_ELAPSED_TIME, metric.getOkMaxTime(), 8.001); +assertEquals("After reset in TIMED mode all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 8.001); assertEquals("After reset hits", 0, metric.getHits(), 0.0); assertEquals("After reset sent bytes", 0, metric.getSentBytes(), 0.0); assertEquals("After reset received bytes", 0, metric.getReceivedBytes(), 0.0); @@ -151,16 +151,16 @@ public class SamplerMetricFixedModeTest { assertEquals("We are recognized as a TransactionController made sample", Boolean.TRUE, Boolean.valueOf(TransactionController.isFromTransactionController(sample))); metric.addCumulated(sample); -assertEquals("Before reset ko.max", DEFAULT_ELAPSED_TIME, metric.getKoMaxTime(), 4.001); -assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 4.001); +assertEquals("Before reset ko.max", DEFAULT_ELAPSED_TIME, metric.getKoMaxTime(), 8.001); +assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 8.001); assertEquals("Before reset failures", 1, metric.getFailures(), 0.0); assertEquals("Before reset sent bytes", 2000, metric.getSentBytes(), 0.0); assertEquals("Before reset received bytes", 4000, metric.getReceivedBytes(), 0.0); metric.resetForTimeInterval(); -assertEquals("After reset in TIMED mode ko.max", DEFAULT_ELAPSED_TIME, metric.getKoMaxTime(), 4.0); -assertEquals("After reset in TIMED mode all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 4.0); +assertEquals("After reset in TIMED mode ko.max", DEFAULT_ELAPSED_TIME, metric.getKoMaxTime(), 8.001); +assertEquals("After reset in TIMED mode all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 8.001); assertEquals("After reset failures", 0, metric.getFailures(), 0.0); assertEquals("After reset sent bytes", 0, metric.getSentBytes(), 0.0); assertEquals("After reset received bytes", 0, metric.getReceivedBytes(), 0.0); diff --git a/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java b/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java index 17a90a7..833d36e 100644 --- a/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java +++ b/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java
[jmeter] branch master updated: Freestyle format for names in (Default)SamplerCreator
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git The following commit(s) were added to refs/heads/master by this push: new c280cf3 Freestyle format for names in (Default)SamplerCreator c280cf3 is described below commit c280cf351938899cbe996ef6563dbeca0940f90f Author: Felix Schumacher AuthorDate: Tue Sep 1 14:56:47 2020 +0200 Freestyle format for names in (Default)SamplerCreator Initialize format string correctly when script recorder is created by hand instead of with a template. Bugzilla Id: 64696 Relates to #595 --- .../org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java index dc0cd53..a01dd58 100644 --- a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java +++ b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java @@ -61,6 +61,7 @@ import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.Timer; +import org.apache.commons.lang3.StringUtils; import org.apache.jmeter.control.Controller; import org.apache.jmeter.control.gui.LogicControllerGui; import org.apache.jmeter.control.gui.TreeNodeWrapper; @@ -332,7 +333,10 @@ public class ProxyControlGui extends LogicControllerGui implements JMeterGUIComp model.setRegexMatch(regexMatch.isSelected()); model.setContentTypeInclude(contentTypeInclude.getText()); model.setContentTypeExclude(contentTypeExclude.getText()); -model.setHttpSampleNameFormat(httpSampleNameFormat.getText()); + httpSampleNameFormat.setEnabled(httpSampleNamingMode.getSelectedIndex() == 3); +if (StringUtils.isNotBlank(httpSampleNameFormat.getText())) { +model.setHttpSampleNameFormat(httpSampleNameFormat.getText()); +} TreeNodeWrapper nw = (TreeNodeWrapper) targetNodes.getSelectedItem(); if (nw == null) { model.setTarget(null);