Reduce flakiness in io.opentelemetry.instrumentation.jmx.rules.WildflyTest.testWildflyMetrics(String)[1]#18502
Closed
trask wants to merge 2 commits into
Conversation
…yTest.testWildflyMetrics(String)[1] Automated fix attempt based on Develocity flaky-test analysis.
Member
Author
|
Closing in favor 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)[1].instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/WildflyTest.javaRecent failed/flaky scans
:instrumentation:jmx-metrics:library:test)Flake history (per UTC day)
Sample failure (from Develocity)
Copilot diagnosis
Root cause
WildflyTeststarted WildFly and immediately verified all captured OTLP metric exports without ever sending a real HTTP request to the deployed test application. The sample failure consistently showedwildfly.network.iomissing thenetwork.io.direction=receivedatapoint for the default listener, which can happen when Undertow listener metrics are scraped before the listener has received request bytes. BecauseTargetSystemTest.verifyMetrics()verifies every export accumulated since test start, an early incomplete export stayed in the queue and could keep the Awaitility assertion failing even if later exports became complete.Fix
javaxservlet path for the old WildFly image and thejakartapath for the newer image.IOExceptions while the deployment finishes.resetMetrics()helper and clear pre-warmup OTLP exports before running the existing metric verifier.Why this addresses the root cause
The real servlet request initializes the Undertow listener request and network counters, including both receive and transmit directions, before the assertions inspect exported metrics. Clearing captured exports after the warm-up prevents a pre-request scrape with incomplete network datapoints from being rechecked on every Awaitility poll.
Risks / follow-ups
TargetSystemTest.verifyMetrics()should ignore older failed snapshots once newer exports satisfy assertions, but this change keeps the fix scoped to the flaky WildFly test.Review the diagnosis and the diff carefully before merging - automated fixes can mask flakiness instead of addressing the root cause.