fix(ci): stabilize tracecontext job#5149
Open
MukundaKatta wants to merge 1 commit intoopen-telemetry:mainfrom
Open
fix(ci): stabilize tracecontext job#5149MukundaKatta wants to merge 1 commit intoopen-telemetry:mainfrom
MukundaKatta wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
Replace the racy 'sleep 1' before the W3C tracecontext tests with an active readiness probe against 127.0.0.1:5000. The fixed sleep was too short on slow CI runners and produced intermittent connection errors against the Flask example server. Closes open-telemetry#5104
|
|
MikeGoldsmith
approved these changes
Apr 27, 2026
Member
MikeGoldsmith
left a comment
There was a problem hiding this comment.
Looks good, thanks @MukundaKatta 🚀
emdneto
approved these changes
Apr 27, 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.
Why
The
tracecontextCI job is reported to flake intermittently (#5104). The integration script starts a Flask example server and then waits a hard-codedsleep 1before running the W3C tests. On slow runners Flask is not yet listening when the tests start, and pytest fails with connection errors against127.0.0.1:5000(per the failed run referenced in the issue: https://github.com/open-telemetry/opentelemetry-python/actions/runs/24451853608/job/71442431200).The issue author suggested adding readiness logic; this PR does exactly that.
What
In
scripts/tracecontext-integration-test.sh:sleep 1.wait_for_serverfunction that polls127.0.0.1:5000for up to 30s with a 0.5s interval.nc/curlbeing installed on the runner image.trap onshutdown EXITregistration before the readiness wait so that a failed readiness probe still cleans up the background server.No behavior change in the happy path; the only observable difference is faster startup (typically <1s) and deterministic failure messages instead of cryptic connection errors.
Tested
:5000. A port-readiness probe is the standard fix for this class of CI race.tests/w3c_tracecontext_validation_server.py) to confirm it serves on the default Flask port127.0.0.1:5000./bin/shcompatible (no bashisms introduced).Fixes #5104