Skip to content

test(e2e): always tear down DDA before next subtest to avoid races#2954

Open
tbavelier wants to merge 2 commits intomainfrom
fix/e2e-ksm-ccr-1-19-sa-token-race
Open

test(e2e): always tear down DDA before next subtest to avoid races#2954
tbavelier wants to merge 2 commits intomainfrom
fix/e2e-ksm-ccr-1-19-sa-token-race

Conversation

@tbavelier
Copy link
Copy Markdown
Member

Summary

  • Adds an applyDDA helper to TestGenericK8s that does a WithoutDDA pre-step before applying each new DatadogAgent, and routes every DDA-applying subtest through it.
  • Fixes the K8s 1.19-only flake on KSM_check_works_cluster_check_runner where the new node-agent DaemonSet pod would sit in FailedMount on its auto-generated <sa>-token-<rand> Secret because the legacy SA-token controller (pre-TokenRequest, pre-1.20) couldn't keep up with the SA delete+create churn from a direct DDA swap.
  • Collapses the inline two-step WithoutDDA boilerplate that APM and DSD UDP subtests already had (net −5 lines).

The same race is latent on every other subtest that swaps DDAs; doing the cleanup uniformly removes that exposure (DSD UDS, Autodiscovery, Logs were unprotected before). On K8s ≥1.20 the cleanup step is essentially a no-op for the SA-token path, but still useful for hostPort rebinding.

Test plan

  • make K8S_VERSION=1.19 e2e-tests passes without retries
  • CI matrix passes on the other supported K8s versions

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.92%. Comparing base (c08166e) to head (fe6a71a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2954   +/-   ##
=======================================
  Coverage   40.92%   40.92%           
=======================================
  Files         324      324           
  Lines       28750    28750           
=======================================
  Hits        11767    11767           
  Misses      16129    16129           
  Partials      854      854           
Flag Coverage Δ
unittests 40.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c08166e...fe6a71a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@datadog-prod-us1-6
Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 41.04% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fe6a71a | Docs | Datadog PR Page | Give us feedback!

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