Skip to content
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

Merged
merged 4 commits into from
Sep 28, 2019
Merged

Coalescing bulkloader sample #336

merged 4 commits into from
Sep 28, 2019

Conversation

sheepdreamofandroids
Copy link
Contributor

Hey Ben,

Looks like you merged without taking the changes?
Anyway, here's the PR again. Better luck this time!

cheers, Guus

@coveralls
Copy link

coveralls commented Aug 5, 2019

Coverage Status

Coverage increased (+0.2%) to 93.737% when pulling d59d8dc on sheepdreamofandroids:coalescing-bulkloader-sample into a915558 on ben-manes:master.

@ben-manes
Copy link
Owner

Thanks! Can you please take a quick look at this test failure? It seems like a race condition because if I run with a mvn clean test it passes, but not with a subsequent mvn test.

-------------------------------------------------------
 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

@sheepdreamofandroids
Copy link
Contributor Author

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?

@ben-manes
Copy link
Owner

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

@ben-manes ben-manes force-pushed the master branch 2 times, most recently from a7697bd to a915558 Compare August 9, 2019 06:37
@ben-manes ben-manes force-pushed the master branch 4 times, most recently from 487066e to 19f0911 Compare August 26, 2019 08:23
@ben-manes
Copy link
Owner

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.

@ben-manes ben-manes merged commit 195045b into ben-manes:master Sep 28, 2019
@ben-manes
Copy link
Owner

haha, and it failed again locally. It is flaky on my laptop unfortunately.

ben-manes pushed a commit that referenced this pull request Sep 28, 2019
@sheepdreamofandroids
Copy link
Contributor Author

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.
The reason that it fails more often on your mac might be that (AFAIK) a mac prioritizes GUI over other processes. As long as CI is unaffected I guess that's OK.

@ben-manes
Copy link
Owner

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.

@Stephan202 Stephan202 mentioned this pull request Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants