← Back to Pull requests

fix(smoke-tests): replace fixed sleep with readiness-aware curl retries #37

Closed
unknown closed this pull request without merging on Oct 05, 2026 09:12 UTC
View on GitHub
unknown unknown commented on Oct 02, 2026 10:16 UTC
Author

Summary

The Test step of the Build go-dvwa smoke-test job ran sleep 1 and then probed the app with curl --retry 3 --fail. This is a readiness race that failed the dd-trace-go nightly AppSec Tests run:

  • Docker's userland proxy binds the host port as soon as the container starts, so curl's TCP connect always succeeds.

  • When the app inside the container has not bound its socket yet, the connection is reset and curl exits with code 56 (Recv failure: Connection reset by peer).

  • curl --retry does not treat exit 56 as a transient error, so it made exactly one attempt and failed the job — even though the app was up ~185 ms later.

  • A larger fixed sleep would only widen the window; app boot time is not tightly bounded (the tracer/AppSec init does network I/O during startup).
  • Fix: drop the sleep and retry until the app answers, using flags that cover connection-reset failures:

  • --retry 30 --retry-delay 1: up to ~30 s budget, used only when needed.

  • --retry-all-errors: makes exit 56 (and connection refused, etc.) retryable. Available since curl 7.71; GitHub runners ship curl 8.5.0.

  • --max-time 5: caps each attempt so a hung container counts as a failed attempt instead of stalling forever.
  • The happy path stays fast; a slow app boot gets real headroom instead of a fixed 1 s.

    Evidence: https://github.com/DataDog/dd-trace-go/actions/runs/36798481563/job/110167294608 — curl connected at 00:55:52.382, got RST, exited 56; the app printed Serving application on 0.0.0.0:7777 at 00:55:52.568.

    Tests

    Workflow-only change; validated with actionlint (the reported issues are pre-existing, in the untouched matrix job).

    Diff: 208 lines (+156 / -52) across 2 files Reviewer: eliottness Review duration: 4256m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 208 lines diff across 2 files
    0.36
    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.320
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #37"
    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: 36.4% (MEDIUM) · Higher = larger blast radius
    36.4%
    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.4% · Safe to merge
    14.4%