fix(ddtrace/tracer): TestSpansStartedTags#4000
Conversation
|
Bits AI Dev Agent Status: ✅ Done You can ask for changes by mentioning @DataDog in a comment. |
BenchmarksBenchmark execution time: 2025-09-29 13:41:46 Comparing candidate commit faa5e26 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics. |
DD_WY1U4Y Co-authored-by: darccio <[email protected]>
cd0ab9c to
faa5e26
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
The expected merge time in
Tests failed on this commit aa43c73: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
Co-authored-by: datadog-official[bot] <214633350+datadog-official[bot]@users.noreply.github.com>
PR by Bits : Fix test TestSpansStartedTags automatically detected by Flaky Test monitoring.
You can ask for changes by mentioning @DataDog in a comment.
Feedback (especially what can be better) welcome in #code-gen-feedback!
What does this PR do?
Replaces the fixed-time wait in TestSpansStartedTags with assert.Eventually to wait for the spans_started metric to reach 1. This change is applied in two places in ddtrace/tracer/metrics_test.go.
Motivation
The test was flaky because the metric increment for datadog.tracer.spans_started happens asynchronously. The previous fixed 100ms wait was sometimes insufficient in CI, leading to intermittent failures where the count was still 0 when asserted. Using assert.Eventually (1s timeout, 10ms poll) removes the timing race and stabilizes the test.
Reviewer's Checklist
./scripts/lint.shlocally.Unsure? Have a question? Request a review!