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:
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.
This PR is to fix a flaky test
com.dianping.cat.message.context.MessageIdFactoryTest#testDefaultDomainInParallel
in modulecat-client
, we found the problem when using the latest version.Reproduce test failures
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.