fix(test-optimization): keep Failed Test Replay working after a probe fails to set or remove #11323
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 381 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.356
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11323"
general
weight: 0.35
BridgeAR
What does this PR do?
When Failed Test Replay fails to set or remove a probe, the Test Optimization Dynamic Instrumentation worker thread crashes. Setting fails, for example, when no loaded script matches the probe's file. The worker's message listeners are
asyncwithout acatch, so the failure becomes an unhandled rejection, which ends the worker. No later probe in the test session is then set, so Failed Test Replay stops capturing snapshots, and each retried test waits out the 2-second limit for its probe.This PR makes the worker acknowledge a failed probe operation along with its error, instead of rejecting. The main thread logs the error and settles the operation as it does for one that succeeded, and the worker keeps handling probes.
A failed
Debugger.setBreakpointcall is now acknowledged the same way. The worker used to catch it and only log it itself, so the probe was acknowledged as set and the failure never reached telemetry.The errors are logged on the main thread because the worker's own logs don't reach telemetry. Until now, these failures only reached telemetry after the crash, as
Test Visibility - Dynamic Instrumentation worker error. They now appear asTest Optimization - Dynamic Instrumentation failed to set probeor... failed to remove probe.Motivation
We found this while checking whether the worker's
Unknown probe iderrors could use theSafeErrorfrom #11290. On master, the crash is reachable in practice: whenDebugger.setBreakpointfails, the worker logs the failure and still acknowledges the probe, so removing that probe later throwsUnknown probe id.Additional Notes
{ probeId, error }instead of a bare probe ID.Debugger.pausedhandler can also reject, for example when capturing a snapshot fails. Catching that needs a guaranteedDebugger.resume, or the test process could stay paused, and a new message type for the main thread's breakpoint-hit handler. It's a separate change.Unknown probe id. The main thread could skip removing probes whose set failed.Tested locally:
dynamic-instrumentation.spec.js: 11 passing. Against master's production code, the new end-to-end test fails because the worker exits, and the new unit tests time out waiting for an acknowledgement. Restoring the worker's oldDebugger.setBreakpointcatch makes the worker test fail.test:trace:core's per-file runner: 810 passing.Debugger.setBreakpointchange, which only affects the failure path.npm run lint,npm run type:check:ciandnpm run lint:editorconfig.Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code via T3 Code.