Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/telemetry: fix flake in TestTelemetryEnabled #3160

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

hannahkm
Copy link
Contributor

@hannahkm hannahkm commented Feb 6, 2025

What does this PR do?

Locks the mockClient before updating the values in Metrics. Also adds an improved error message for the previously failing line.

Closes APMLP-319

Motivation

There was a flake in which TestTelemetryEnabled/tracer_start did not find the correct init time due to a data race, causing random failures that impacts the health of the tracer. In the off chance that the flake reappears, the new error message should help with debugging more thoroughly.

Running the test ~2000 times on both a MacOS computer and in a Windows VM passed. Rerunning CI a few times also only gave successes.

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.
  • 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.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Unsure? Have a question? Request a review!

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 6, 2025

Datadog Report

Branch report: hannahkm/fix-telemetry-flake
Commit report: c096a52
Test service: dd-trace-go

✅ 0 Failed, 5226 Passed, 73 Skipped, 1m 46.6s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Feb 7, 2025

Benchmarks

Benchmark execution time: 2025-02-07 15:52:47

Comparing candidate commit 3bfb4f2 in PR branch hannahkm/fix-telemetry-flake with baseline commit 4a72a09 in branch main.

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

@hannahkm hannahkm marked this pull request as ready for review February 7, 2025 16:06
@hannahkm hannahkm requested review from a team as code owners February 7, 2025 16:06
@hannahkm hannahkm merged commit 9462231 into main Feb 7, 2025
176 checks passed
@hannahkm hannahkm deleted the hannahkm/fix-telemetry-flake branch February 7, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants