Reduce flakiness in io.opentelemetry.instrumentation.jmx.rules.CamelTest.testCollectedMetrics()#18491
Closed
trask wants to merge 2 commits into
Conversation
…est.testCollectedMetrics() Automated fix attempt based on Develocity flaky-test analysis.
This was referenced May 1, 2026
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.
Fixes flakiness in
io.opentelemetry.instrumentation.jmx.rules.CamelTest.testCollectedMetrics().instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/CamelTest.javaRecent failed/flaky scans
:instrumentation:jmx-metrics:library:test):instrumentation:jmx-metrics:library:test):instrumentation:jmx-metrics:library:test):instrumentation:jmx-metrics:library:test):instrumentation:jmx-metrics:library:test)Flake history (per UTC day)
Sample failure (from Develocity)
Diagnosis
The container wait strategy used a custom
Camel test application startedlog line from the test application. That log line was emitted beforemain.run(args), so Testcontainers could consider the target ready before Apache Camel had actually started its routes and finished registering the related JMX MBeans.Fix
Apache Camel ... started in ....Why this addresses the flake
The failing assertion expects destination-aware Camel processor datapoints to be present. Waiting for Camel's actual startup completion reduces the race where metrics are verified after the application process exists but before Camel routes/processors have finished startup.
Risks / follow-ups
If Camel's
started inlog can still appear before all relevant JMX MBeans or destination-aware attributes are visible to the JMX scraper, this may reduce but not fully eliminate the flake. If flakiness continues, the next likely step is to avoid verifying stale pre-ready OTLP exports, or to make the metrics verifier evaluate a coherent later export instead of accumulating and rechecking earlier incomplete exports.