Skip to content

fix: flaky test#4033

Merged
dd-mergequeue[bot] merged 1 commit into
mainfrom
raphael/fix_flake
Oct 8, 2025
Merged

fix: flaky test#4033
dd-mergequeue[bot] merged 1 commit into
mainfrom
raphael/fix_flake

Conversation

@raphaelgavache

Copy link
Copy Markdown
Member

When a span is finished writes to meta/metrics require the lock to be held. This is due to first span of the first chunk calling setMeta which both calls a delete on metrics map and inserts in meta map.
Test calls need to be protected to avoid the flake

Motivation

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@raphaelgavache
raphaelgavache requested a review from a team as a code owner October 7, 2025 19:34
@raphaelgavache raphaelgavache changed the title fix metrics access fix: flaky test Oct 7, 2025
@pr-commenter

pr-commenter Bot commented Oct 7, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-10-07 19:47:31

Comparing candidate commit 88dc574 in PR branch raphael/fix_flake with baseline commit 23545d4 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics.

@datadog-datadog-prod-us1

Copy link
Copy Markdown

⚠️ Tests

⚠️ Warnings

❄️ 1 New flaky test detected

TestReportHealthMetricsAtInterval from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog) (✨ Fix with BitsAI)
Failed

=== RUN   TestReportHealthMetricsAtInterval
    metrics_test.go:65: 
        	Error Trace:	/home/runner/work/dd-trace-go/dd-trace-go/ddtrace/tracer/metrics_test.go:65
        	Error:      	Not equal: 
        	            	expected: 1
        	            	actual  : 0
        	Test:       	TestReportHealthMetricsAtInterval
--- FAIL: TestReportHealthMetricsAtInterval (0.09s)

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 88dc574 | Docs | Was this helpful? Give us feedback!

@raphaelgavache

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Oct 7, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-10-07 20:20:05 UTC ℹ️ Start processing command /merge


2025-10-07 20:20:13 UTC ℹ️ MergeQueue: waiting for PR to be ready

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.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-10-08 00:21:06 UTC ⚠️ MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

@darccio

darccio commented Oct 8, 2025

Copy link
Copy Markdown
Member

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Oct 8, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-10-08 08:07:53 UTC ℹ️ Start processing command /merge


2025-10-08 08:07:58 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 18m (p90).


2025-10-08 08:22:57 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue
dd-mergequeue Bot merged commit 5507d97 into main Oct 8, 2025
266 of 271 checks passed
@dd-mergequeue
dd-mergequeue Bot deleted the raphael/fix_flake branch October 8, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants