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

Fix test failures #2320

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix test failures #2320

wants to merge 1 commit into from

Conversation

dserfe
Copy link

@dserfe dserfe commented Oct 26, 2023

This PR is to fix a flaky test com.dianping.cat.message.context.MessageIdFactoryTest#testDefaultDomainInParallel in module cat-client, we found the problem when using the latest version.

Reproduce test failures

  • Run the following commands to reproduce the test failures:
mvn  edu.illinois:nondex-maven-plugin:2.1.1:nondex  -pl cat-client -Dtest=com.dianping.cat.message.context.MessageIdFactoryTest#testDefaultDomainInParallel
  • Then we got the following error:
MessageIdFactoryTest.testDefaultDomainInParallel:108 Not all threads completed in time. expected:<123400> but was:<12070>

Fix

In order to avoid not all threads not finished before the assertions, the fix is to first wait the jobs to be finished pool.awaitTermination(1, TimeUnit.HOURS); , after that if al threads are done, then go to the following assertions.

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.

1 participant