Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-7158

EmbeddedApplicationPublishedBridgeTest.testEventBridge random failures

XMLWordPrintable

      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.

            slaskawi@redhat.com Sebastian Ɓaskawiec (Inactive)
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: