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

ARTEMIS-2016 fix flaky test QueueControlTest#testRemoveAllWithPagingMode #2226

Closed

Conversation

jirkadanek
Copy link

Parameters going into Wait.waitFor were originally wrong, because
durationMillis: 3, sleepMillis: 100 means you would test the condition
only once. This commit is changing the durationMillis from 3ms to 3s,
swapping the two numbers (duration 100ms, sleep 3ms) would also be reasonable, I think.

Next, Wait.assertEquals is here being used, instead of Assert.assertTrue.

I saw the test fail only once, and never was able to reproduce it again,
but I think this commit does improve the test and so it is worthwhile.

java.lang.AssertionError
	at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.assertMetrics(QueueControlTest.java:2651)
    at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.assertMessageMetrics(QueueControlTest.java:2615)
	at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.testRemoveAllWithPagingMode(QueueControlTest.java:1554)

Parameters going into Wait.waitFor were originally wrong, because
`durationMillis: 3, sleepMillis: 100` means you would test the condition
only once. This commit is changing the durationMillis from 3ms to 3s,
swapping the two numbers (duration 100ms, sleep 3ms) would also be reasonable, I think.

Next, Wait.assertEquals is here being used, instead of Assert.assertTrue.

I saw the test fail only once, and never was able to reproduce it again,
but I think this commit does improve the test and so it is worthwhile.

    java.lang.AssertionError
		at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.assertMetrics(QueueControlTest.java:2651)
	    at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.assertMessageMetrics(QueueControlTest.java:2615)
    	at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.testRemoveAllWithPagingMode(QueueControlTest.java:1554)
@asfgit asfgit closed this in 7480452 Aug 8, 2018
@jirkadanek jirkadanek deleted the jd_maybe_swapped_wait_args branch August 8, 2018 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants