Reduce flakiness in io.opentelemetry.instrumentation.jmx.rules.WildflyTest.testWildflyMetrics(String)[2]#18512
Closed
trask wants to merge 1 commit into
Conversation
…yTest.testWildflyMetrics(String)[2] Automated fix attempt based on Develocity flaky-test analysis.
laurit
approved these changes
May 2, 2026
Member
Author
|
Closing as duplicate of #18509 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Automated attempt at fixing flakiness in
io.opentelemetry.instrumentation.jmx.rules.WildflyTest.testWildflyMetrics(String)[2].instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/WildflyTest.javaFlake history (per UTC day)
Sample failure (from Develocity)
Copilot diagnosis
Root cause
No failure payload or build scan was available, but the flaky parameter is the current WildFly image and the test source showed that container readiness only waited for port 8080 to listen. WildFly can bind the listener before the copied
testapp.warhas finished deploying and before the deployment-scoped Undertow MBeans used by the assertions are available. Under slower container starts, the JMX exporter can begin collecting before those MBeans exist, making the later metric polling race application deployment.Fix
/testapp/javax/for the legacy WildFly 10 image and/testapp/jakarta/for the current WildFly image, preserving coverage for both servlet API generations.Why this addresses the root cause
The test now starts metric verification only after WildFly has deployed the WAR and can serve the servlet endpoint, which is the same application deployment that creates the session-related MBeans asserted by the test. This removes the race between early port binding and delayed deployment while preserving the original end-to-end JMX metric coverage.
Risks / follow-ups
Review the diagnosis and the diff carefully before merging - automated fixes can mask flakiness instead of addressing the root cause.