Skip to content

test(agent): fix dead double-send in handleTraceRequest#7725

Merged
tlhunter merged 1 commit intomasterfrom
watson/fix-agent
Mar 11, 2026
Merged

test(agent): fix dead double-send in handleTraceRequest#7725
tlhunter merged 1 commit intomasterfrom
watson/fix-agent

Conversation

@watson
Copy link
Copy Markdown
Collaborator

@watson watson commented Mar 10, 2026

What does this PR do?

Fixes a dead code path in handleTraceRequest in the test agent helper (packages/dd-trace/test/plugins/agent.js). When the test agent returned a non-200 status, the code attempted to call res.status(400).send() — but res.status(200).send() had already been called synchronously earlier in the same function, so the error response was silently dropped. This meant test agent errors were completely invisible.

Replaces the dead send with a console.warn so test agent errors are visible in CI logs. Also removes the res._closed guard which only existed to protect the now-removed res.status(400) call.

Motivation

Discovered while investigating a flaky AI Guard Windows CI timeout. The silent error swallowing made it harder to reason about test agent behavior and could mask issues with CI test reporting.

Loading
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