diff --git a/pkg/cmd/roachtest/tests/disk_stall.go b/pkg/cmd/roachtest/tests/disk_stall.go index 13eee2858266..4610b8df1f07 100644 --- a/pkg/cmd/roachtest/tests/disk_stall.go +++ b/pkg/cmd/roachtest/tests/disk_stall.go @@ -159,7 +159,11 @@ func runDiskStalledDetection( m.ExpectDeath() } s.Stall(ctx, c.Node(1)) - defer s.Unstall(ctx, c.Node(1)) + // NB: We use a background context in the defer'ed unstall command, + // otherwise on test failure our c.Run calls will be ignored. Leaving the + // disk stalled will prevent artifact collection, making debugging + // difficult. + defer s.Unstall(context.Background(), c.Node(1)) // Wait twice the maximum sync duration and check if our SQL connection to // node 1 is still alive. It should've been terminated.