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

Test Race Condition: PeriodicStatisticsSinkTest.testRecordProcessedAggregateData #77

Open
vjkoskela opened this issue Jan 2, 2018 · 0 comments

Comments

@vjkoskela
Copy link
Member

Looks like we have a race condition in evaluating the execution results of the PeriodicStatisticsSink.

Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.45 sec <<< FAILURE! - in com.arpnetworking.tsdcore.sinks.PeriodicStatisticsSinkTest
testRecordProcessedAggregateData(com.arpnetworking.tsdcore.sinks.PeriodicStatisticsSinkTest)  Time elapsed: 0.395 sec  <<< FAILURE!
org.mockito.exceptions.verification.TooManyActualInvocations: 
metrics.close();
Wanted 1 time:
-> at com.arpnetworking.tsdcore.sinks.PeriodicStatisticsSinkTest.testRecordProcessedAggregateData(PeriodicStatisticsSinkTest.java:101)
But was 2 times. Undesired invocation:
-> at com.arpnetworking.tsdcore.sinks.PeriodicStatisticsSink.flushMetrics(PeriodicStatisticsSink.java:164)
	at com.arpnetworking.tsdcore.sinks.PeriodicStatisticsSinkTest.testRecordProcessedAggregateData(PeriodicStatisticsSinkTest.java:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	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 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	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.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:393)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
Results :
Failed tests: 
  PeriodicStatisticsSinkTest.testRecordProcessedAggregateData:101 
metrics.close();
Wanted 1 time:
-> at com.arpnetworking.tsdcore.sinks.PeriodicStatisticsSinkTest.testRecordProcessedAggregateData(PeriodicStatisticsSinkTest.java:101)
But was 2 times. Undesired invocation:
-> at com.arpnetworking.tsdcore.sinks.PeriodicStatisticsSink.flushMetrics(PeriodicStatisticsSink.java:164)
Tests run: 569, Failures: 1, Errors: 0, Skipped: 6
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.503 s
[INFO] Finished at: 2018-01-02T17:03:32+00:00
[INFO] Final Memory: 55M/537M
[INFO] ------------------------------------------------------------------------
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

No branches or pull requests

1 participant