Details
-
Bug
-
Resolution: Done
-
Critical
-
None
Description
TimeUnit.SECONDS.sleep(1) doesn't guarantee that the thread actually sleeps for a full second. And if it wakes up a millisecond too early, the entry is not expired by the time of the check:
java.lang.AssertionError: expected [null] but found [org.springframework.cache.support.SimpleValueWrapper@7bbbe232] at org.testng.Assert.fail(Assert.java:94) at org.testng.Assert.failNotSame(Assert.java:490) at org.testng.Assert.assertNull(Assert.java:426) at org.testng.Assert.assertNull(Assert.java:415) at org.infinispan.spring.session.InfinispanApplicationPublishedBridgeTCK.testEventBridge(InfinispanApplicationPublishedBridgeTCK.java:58) at org.infinispan.spring.session.EmbeddedApplicationPublishedBridgeTest.testEventBridge(EmbeddedApplicationPublishedBridgeTest.java:59)
The test should use a TimeService to guarantee that the entry expires without having to wait so long.
Attachments
Issue Links
- is related to
-
JDG-557 EmbeddedApplicationPublishedBridgeTest.testEventBridge random failures
- Closed