Skip to content

fix(parametric): wait for post-restart Node telemetry - #7464

Open
bm1549 wants to merge 7 commits into
mainfrom
brian.marks/fix-stale-telemetry-config-wait
Open

bm1549 wants to merge 7 commits into
mainfrom
brian.marks/fix-stale-telemetry-config-wait

Conversation

@bm1549

@bm1549 bm1549 commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Read the illustrated problem and fix report (Datadog AppGate)

The Node.js stable configuration tests restarted the test app and then read any telemetry already held by the test agent. A pre-restart configuration could be checked before the new runtime sent its app-started payload, making the assertion flaky.

Changes

Capture the current Node.js runtime ID before restart and wait for a different app-started runtime afterward. Read configuration only from that runtime, then use the existing assertions and newest sequence for each setting.

The runtime wait now uses the same four-second budget as the existing delayed app-started coverage. The restored regression tests cover a late post-restart runtime, restart ordering, a stale matching value from the old runtime, and a superseded configuration sequence with a missing seq_id.

Testing

  • ./run.sh TEST_THE_TEST -q --disable-warnings --tb=no (630 passed, 2734 deselected, 1 xfailed)
  • TEST_LIBRARY=nodejs ./run.sh PARAMETRIC tests/parametric/test_config_consistency.py::Test_Stable_Config_Default::test_extended_configs (4 passed)
  • ./format.sh

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Tests, manifest, weblog are modified -> you'll need a review from system-tests-reviewers: ask to one of youre co-worker familiar with the tested feature.
    • Framework is modified, or non obvious usage of it -> get a review from system-tests-core (slack)

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/test_the_test/test_test_agent.py                                  @DataDog/system-tests-reviewers
tests/parametric/conftest.py                                            @DataDog/system-tests-reviewers
tests/parametric/test_config_consistency.py                             @DataDog/apm-sdk-capabilities
utils/docker_fixtures/_test_agent.py                                    @DataDog/system-tests-core

@bm1549 bm1549 added the ai-generated The pull request includes a significant amount of AI-generated code label Aug 5, 2026
@bm1549
bm1549 force-pushed the brian.marks/fix-stale-telemetry-config-wait branch from b1ef15c to 98cfc58 Compare August 6, 2026 19:38
@bm1549
bm1549 marked this pull request as ready for review September 11, 2026 02:37
@bm1549
bm1549 requested review from a team as code owners September 11, 2026 02:37
@bm1549
bm1549 requested review from anna-git and removed request for a team September 11, 2026 02:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-11T02:40:04.843203Z 2a98a51 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@anna-git

Copy link
Copy Markdown
Contributor

The PR description says "The regression tests (see commit 3) cover a late post-restart runtime, a stale matching value from the old runtime, and a superseded configuration sequence" — but commit 142a361 deletes that exact test file (tests/test_the_test/test_test_agent.py), and I don't see it moved elsewhere. As it stands, wait_for_telemetry_runtime_id, restart_and_get_runtime_id, and the new unconditional seq_id sort have no test coverage, and the PR description is now inaccurate. Was this deletion intentional, or should the tests be restored?

@anna-git

Copy link
Copy Markdown
Contributor

wait_for_telemetry_runtime_id has a fairly tight total wait budget: wait_loops=200 × time.sleep(0.01) ≈ 2s (plus request latency), and it only starts counting after container_restart() has already confirmed the new process's HTTP server is up. Other wait_for_telemetry_event("app-started", ...) call sites in this repo (e.g. test_telemetry.py:1000) already override the default up to wait_loops=400 (~4s) because 2s has apparently been found too tight for app-started specifically. If the tracer's first telemetry flush lags container readiness under load (busy CI runner), this could raise AssertionError here instead of the stale-config flake this PR is fixing. Worth bumping the budget or aligning it with wait_for_telemetry_configurations's loop/sleep values for consistency?

@anna-git anna-git left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments are NIT

@bm1549
bm1549 requested a review from a team as a code owner September 30, 2026 13:18
@datadog-official

datadog-official Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

✨ Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 70 Pipeline jobs failed

Testing the test | all-jobs-are-green — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Testing the test | System Tests (golang, prod) / End-to-end #1 / uds-echo 1 — 🔄 Retry may pass, looks flaky

View more details · View in GitHub Actions

Testing the test | System Tests (cpp_httpd, dev) / End-to-end #1 / httpd 1

View more details · View in GitHub Actions

View all 70 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1978a4f | Docs | View more details | Give us feedback!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated The pull request includes a significant amount of AI-generated code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants