[Debugger Tests] Surface sample exit diagnostics during /stop cleanup#8571
Conversation
BenchmarksBenchmark execution time: 2026-05-06 15:27:43 Comparing candidate commit 5661419 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 64 known flaky benchmarks, 23 flaky benchmarks without significant changes.
|
When a debugger integration test's sample process crashes or exits early, the test currently fails on the /stop HTTP call with a connection-refused error, masking the real cause (the sample's exit code, stdout, stderr). In StopSample: * If Process.HasExited before sending /stop, log stdout/stderr/exit code and surface the exit code via ExitCodeException.ThrowIfNonZero. * Wrap the WebRequest call in try/catch for WebException whose inner is HttpRequestException or SocketException, and apply the same handling when the process has exited mid-request. This makes failing snapshot/probe tests show the real crash output instead of a connection error. Co-authored-by: Cursor <[email protected]>
Add focused coverage for the debugger sample helper path where the sample process has already exited with a non-zero code, ensuring StopSample surfaces the real exit code, stdout, and stderr instead of hiding the failure behind /stop cleanup.
9826b2b to
5661419
Compare
Summary of changes
DebuggerSampleProcessHelper.StopSamplenow surfaces the actual sample-process exit code, stdout, and stderr when the process exits before or during the/stopHTTP call.Process.HasExitedbefore issuing/stop, then usesExitCodeException.ThrowIfNonZeroso crashes fail with the real process exit information./stoptransport failures caused byHttpRequestExceptionorSocketException; if the process exited mid-request, the same diagnostics are logged and the exit code is surfaced.Reason for change
/stop, hiding the real exit code and sample output.Implementation details
/stopfailures are translated, and only when the process has exited.Test coverage
DebuggerSampleProcessHelperTests.StopSample_WhenProcessAlreadyExitedWithNonZeroExitCode_SurfacesExitDetails.