Reduce flakiness in OtelSpringStarterSmokeTest.shouldSendTelemetry()#18476
Merged
Conversation
…erSmokeTest.shouldSendTelemetry() Automated fix attempt based on Develocity flaky-test analysis.
laurit
reviewed
May 1, 2026
| continue; | ||
| } | ||
| // jvm.network.io is flaky on all JDK versions | ||
| if ("jvm.network.io".equals(metric)) { |
Contributor
There was a problem hiding this comment.
Might as well remove it from the list above
laurit
approved these changes
May 1, 2026
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.spring.smoketest.OtelSpringStarterSmokeTest.shouldSendTelemetry().smoke-tests-otel-starter/spring-boot-2/src/test/java/io/opentelemetry/spring/smoketest/OtelSpringStarterSmokeTest.javaRecent failed/flaky scans
:smoke-tests-otel-starter:spring-boot-4:test):smoke-tests-otel-starter:spring-boot-3:test):smoke-tests-otel-starter:spring-boot-4:test):smoke-tests-otel-starter:spring-boot-4:test):smoke-tests-otel-starter:spring-boot-3:test)Flake history (per UTC day)
Sample failure (from Develocity)
Copilot diagnosis
Flaky Test Fix Diagnosis
Root cause
The
jvm.network.ioJFR-based metric is unreliable and sometimes not emitted during test execution, regardless of JDK version. The test was only skipping this metric on JDK 25+, but the 271 failures across 7 days occurred on earlier JDK versions (primarily JDK 17-23 based on the Spring Boot 3/4 test profiles). The metric collection is timing-dependent and may not produce data within the test's wait period.Fix
AbstractOtelSpringStarterSmokeTest.assertAdditionalMetrics()to unconditionally skip thejvm.network.iometric assertionjvm.cpu.longlockcontinues to be skipped only on JDK 25+ (where it's missing), whilejvm.network.iois now skipped on all JDK versionsjvm.network.iois flaky on all JDK versions, not just JDK 25Why this addresses the root cause
The fix eliminates the assertion on a fundamentally unreliable metric that was causing 271 test failures in 7 days. By removing the JDK version condition for
jvm.network.io, we prevent failures on JDK 17-24 where the metric is also flaky. The test still validates all other JFR-based runtime metrics, maintaining comprehensive coverage while removing the flaky assertion.Risks / follow-ups
jvm.network.iobecomes consistently reliable in future JDK or OpenTelemetry versions, this skip could mask a legitimate regression. Maintainers should periodically check if the metric can be re-enabled.otel.instrumentation.runtime-telemetry.emit-experimental-jfr-metrics=trueproperty, so functional coverage isn't completely lost.jvm.network.iospecifically is unreliable compared to other JFR metrics—it may point to an upstream JFR event availability issue that could be reported to the OpenTelemetry Java instrumentation or JFR teams.Review the diagnosis and the diff carefully before merging - automated fixes can mask flakiness instead of addressing the root cause.