jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Sitnikov <sitnikov.vladi...@gmail.com>
Subject Re: Build failed in Jenkins: JMeter Ubuntu #929
Date Mon, 04 Nov 2019 21:14:42 GMT
PS. I guess the problem with the test is
that org.apache.jmeter.protocol.http.control.CacheManager#extractExpiresDateFromCacheControl
uses System.currentTimeMillis() for max-age.

>So is there a way to show the line number in the test log?

This looks like a Gradle bug.
By default it truncates the stacktrace to the first frame with "test
class", and by default it does show the line.

TestCacheManagerUrlConnection is different: it does not contain test
methods,
and the class is not present in the stacktrace. The test methods are
inherited, and it seems to confuse output formatter.

>- the test itself uses the same text for various different errors

In practice, "test failures should look like a good bug report".
The mere use of "unique messages" does not make the messages good or
actionable or understandable.

For instance, the test in question is using the following:

assertNull(getThreadCacheEntry(LOCAL_HOST), "Should not find entry");
(1) assertFalse(this.cacheManager.inCache(url), "Should not find valid entry");

...

cacheResult(sampleResultOK);

...

assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry");
(2) assertTrue(this.cacheManager.inCache(url), "Should find valid entry");

...

assertNotNull(getThreadCacheEntry(LOCAL_HOST), "Should find entry");
(3) assertFalse(this.cacheManager.inCache(url), "Should not find valid entry");


I would suggest:
(1) "start of the test => url should not be in cacheManager"
(2) "just cached the url => it should be in cacheManager"
(3) "entry expires at " + ...  + ", current date is " + ...  + " => url
should not be in cacheManager"

Messages for getThreadCacheEntry asserts could be adjusted as well.
Note: I did not try to make the messages unique. I just put relevant
explanations that clarify **why** the entry should be present/missing.

Vladimir

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message