Address intermittent test failures #2517
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The tests which exercise synthetic
@SimplyTimed
annotation handling when beans are vetoed show intermittent failures.The problem turned out to be in the tests. The base registry (where, by spec, the synthetic
SimpleTimer
metrics go) could be populated with syntheticSimpleTimer
s by earlier tests. Then, when the veto tests would run, and theMetricsCdiExtension
code would correctly ignore vetoed beans and not add the synthetic metrics to the registry again, but the registry entries were already present from earlier tests run in the same JVM. The tests, finding those entries, would report a failure.The difference between the tests passing locally and failing in the pipeline was due to differences in the order in which surefire ran the tests.
I've added a
@BeforeAll
that clears out theREST.request
SimpleTimer
s to remove stale registrations, so the tests of the veto support find no syntheticSimpleTimer
s from previous tests.