← Back to Pull requests

test: stabilize test_symbols_force_upload #18874

Closed
unknown closed this pull request without merging on Jul 14, 2026 17:33 UTC
View on GitHub
unknown unknown commented on Jul 06, 2026 12:53 UTC
Author

<!-- dd-meta {"pullId":"ca1ffea5-0f40-424f-aa47-4b964e52eae3","source":"chat","resourceId":"93887992-255e-4157-87c1-e778a1c4a7b2","workflowId":"298b7755-78e0-4a25-855e-5c40e3c7c028","codeChangeId":"298b7755-78e0-4a25-855e-5c40e3c7c028","sourceType":"test-optimization"} -->

Description

Fixing test_symbols_force_upload[py3.12] • Questions? Ask in #code-gen-flaky-tests

Motivation


test_symbols_force_upload[py3.12] is flaky because this subprocess test implicitly requires empty stderr (err="" default), but ddtrace-run occasionally emits bootstrap warnings to stderr that are unrelated to the symbol upload assertions.

Changes


  • Updated tests/internal/symbol_db/test_symbols.py to set err=None on test_symbols_force_upload.

  • Kept the test logic and assertions unchanged (it still validates forced symbol collection/upload behavior).
  • Testing

  • scripts/run-tests tests/internal/symbol_db/test_symbols.py --list

  • Attempted targeted execution via scripts/run-tests with the py3.12 internal venv hash; blocked by local podman/docker CNI/network setup in this sandbox.

  • python -m pytest -q tests/internal/symbol_db/test_symbols.py -k test_symbols_force_upload (4 runs) was attempted as fallback, but could not load test environment due missing native test extensions in this sandbox.

  • ruff format tests/internal/symbol_db/test_symbols.py

  • ruff check --fix tests/internal/symbol_db/test_symbols.py
  • Risks

    Low. This change only affects subprocess stderr expectations for one flaky test and does not modify production code.

    Additional Notes

    This keeps the test focused on symbol DB behavior instead of failing on non-deterministic bootstrap logging noise from ddtrace-run.

    ---

    PR by Bits - View session in Datadog

    Comment @datadog to request changes

    Diff: 234 lines (+175 / -59) across 2 files Reviewer: grantseltzer Review duration: 11800m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 234 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.327
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #18874"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.1% (MEDIUM) · Higher = larger blast radius
    37.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.7% · Safe to merge
    14.7%