-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coalescing bulkloader sample #336
Coalescing bulkloader sample #336
Conversation
Thanks! Can you please take a quick look at this test failure? It seems like a race condition because if I run with a -------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest
whenEnoughKeysAreRequestedTheLoadWillHappenImmediately[0](com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest) failed, 2 attempts left.
maxDelayIsNotMissedTooMuch[1](com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest) failed, 2 attempts left.
maxDelayIsNotMissedTooMuch[2](com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest) failed, 2 attempts left.
maxDelayIsNotMissedTooMuch[2](com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest) failed, 1 attempts left.
maxDelayIsNotMissedTooMuch[2](com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest) failed, 0 attempts left.
Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.76 sec <<< FAILURE!
maxDelayIsNotMissedTooMuch[2](com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest) Time elapsed: 0.232 sec <<< FAILURE!
java.lang.AssertionError:
Expected: is <1>
but: was <0>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.junit.Assert.assertThat(Assert.java:956)
at org.junit.Assert.assertThat(Assert.java:923)
at com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest.maxDelayIsNotMissedTooMuch(CoalescingBulkloaderTest.java:98)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest$1.try_(CoalescingBulkloaderTest.java:152)
at com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest$1.try_(CoalescingBulkloaderTest.java:156)
at com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest$1.try_(CoalescingBulkloaderTest.java:156)
at com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest$1.evaluate(CoalescingBulkloaderTest.java:147)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Results :
Failed tests: maxDelayIsNotMissedTooMuch[2](com.github.benmanes.caffeine.examples.coalescing.bulkloader.CoalescingBulkloaderTest): (..)
Tests run: 6, Failures: 1, Errors: 0, Skipped: 0 |
Hmmm, I can't make it fail locally. Can you tell me a bit more about your environment, like OS and java version used for running the test? Does it still fail when you increase the delta constant in the test? |
Yes, it seems to fail regardless of which constant I increase. I am running on OS X Mojave with JDK 1.8.0_144. It also fails when switching to JDK 11.0.1 |
a7697bd
to
a915558
Compare
487066e
to
19f0911
Compare
Sorry we never got this resolved. I had the same failures locally, but after playing around it started working properly and I cannot get it to fail anymore. I'll merge, since its been far too long. |
haha, and it failed again locally. It is flaky on my laptop unfortunately. |
Hey Ben, I managed to make it fail on my laptop as well. But only by running 8 benchmarks in parallel in the background and even then only sometimes. Since this test is sensitive to timing I don't think it is anything to worry about. |
Thanks for looking into it! Reviewing the tests it makes sense to be flaky because sleep() is the minimum time rather than a hard real-time guarantee. I agree as long as it’s stable on CI that’s good enough. |
Hey Ben,
Looks like you merged without taking the changes?
Anyway, here's the PR again. Better luck this time!
cheers, Guus