Skip to content

test: unflake tests failing due to test agent startup delays - #21587

Draft
KowalskiThomas wants to merge 1 commit into
mainfrom
dd/kowalski/snapshot-agent-timeout
Draft

KowalskiThomas wants to merge 1 commit into
mainfrom
dd/kowalski/snapshot-agent-timeout

Conversation

@KowalskiThomas

@KowalskiThomas KowalskiThomas commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Description

test_context_multiprocess was flaky snapshot test failed on the latest main pipeline when the shared test agent did not answer session setup within the generic five-second request timeout.

CI Visibility

Representative failure:

TimeoutError: timed out
RuntimeError: Test agent request failed: GET /test/session/start?agent_sample_rate_by_service=%7B%7D&test_session_token=8e3242084c284866bc0160e444646dcb at http://testagent:9126

Flaky Management tracks the same failure across Python versions under DD_AR0A5F, DD_ROKH1H, DD_YCOV1K, DD_MW2WAP, DD_OXXK3U, DD_EVB88F, and DD_ARL3RI. This broader history is separate from the current-main count above.

Changes

  • Allow snapshot session startup three normal request windows so transient test-agent backlog does not fail otherwise healthy tests.
  • Keep snapshot verification and cleanup deadlines unchanged so real comparison and teardown failures still surface promptly.

@datadog-datadog-us1-prod

Copy link
Copy Markdown

View session in Datadog

Bits Code status: ✅ Done

CI Auto-fix: Disabled | Enable

Comment @DataDog to request changes

@datadog-prod-us1-3 datadog-prod-us1-3 Bot added Bits AI changelog/no-changelog A changelog entry is not required for this PR. labels Nov 9, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 83 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 83 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=120)
ddtrace.llmobs._integrations.bedrock -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._integrations.vllm -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._integrations.google_adk -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)
ddtrace.llmobs._integrations.openai_agents -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=118)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against main using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

tests/utils.py                                                          @DataDog/python-guild

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

❌ Errors

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

🚦 5 Pipeline jobs failed

DDCI - DataDog/dd-trace-py | llmobs/llama_index 2/2 — 🔄 Retry may pass, looks flaky

View more details · View in DDCI

DataDog/apm-reliability/dd-trace-py | llmobs/llama_index 2/2 — 🔄 Retry may pass, looks flaky

View more details · View in GitLab

Build | build_wheels / Build cp312-win_arm64

View more details · View in GitHub Actions

View all 5 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: 81e849b | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-11-09 08:37:21

Comparing candidate commit 81e849b in PR branch dd/kowalski/snapshot-agent-timeout with baseline commit e44a5f7 in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 618 metrics, 10 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-704.436ns; +757.967ns] or [-6.601%; +7.102%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-31.869ns; +38.155ns] or [-4.635%; +5.549%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1893.571ns; +1925.203ns] or [-9.504%; +9.663%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1925.190ns; +1768.542ns] or [-9.959%; +9.148%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-377.456ns; +375.674ns] or [-8.796%; +8.754%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-227.894ns; +224.235ns] or [-8.411%; +8.276%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-97.687ns; +84.314ns] or [-6.636%; +5.728%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-5165.805ns; +4635.016ns] or [-10.130%; +9.089%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-1062.540ns; +932.348ns] or [-9.919%; +8.704%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-59.806µs; +50.902µs] or [-10.284%; +8.753%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:packagespackageforrootmodulemapping-cache_off

@KowalskiThomas
KowalskiThomas force-pushed the dd/kowalski/snapshot-agent-timeout branch from e42a7ee to 81e849b Compare November 9, 2026 08:12
@KowalskiThomas KowalskiThomas added testing ci-reliability The PR is related to the CI reliability of dd-trace-py labels Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bits AI changelog/no-changelog A changelog entry is not required for this PR. ci-reliability The PR is related to the CI reliability of dd-trace-py testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant