fix(ddtrace/tracer): avoid race on TestTracerPrioritySampler#4490
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-03-12 16:44:16 Comparing candidate commit 92ae805 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 156 metrics, 8 unstable metrics.
|
| // response asynchronously, so we must poll rather than use a fixed sleep. | ||
| timeout := time.After(time.Second * timeMultiplicator) | ||
| for { | ||
| tr.prioritySampling.mu.RLock() |
There was a problem hiding this comment.
nit: Maybe we should consider adding a prioritySampling.getDefaultRate() function where we guard with mutex.
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 92ae805 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
devflow unqueued this merge request: It did not become mergeable within the expected time |
What does this PR do?
Adds a loop to check if priority sampler is updated on
TestTracerPrioritySampleras we emulate therate_by_serviceof the agent on response.Motivation
Avoid flakiness like https://github.com/DataDog/dd-trace-go/actions/runs/22556129490/job/65333714361#step:8:302
Reviewer's Checklist
make lintlocally.make testlocally.Unsure? Have a question? Request a review!