Skip to content

Commit

Permalink
roachtest: always unstall on disk-stall failure
Browse files Browse the repository at this point in the history
Previously, if the disk-stalled/* raochtests failed while the disk was stalled,
a defer would attempt to unstall the disk before completing the test. This
could fail if the context was cancelled. The stalled disk would then prevent
collection of artifacts.

This change updates the defer'd Unstall call to use a background context that
will never be cancelled.

Epic: none
Informs cockroachdb#102946
Release note: none
  • Loading branch information
jbowens committed May 12, 2023
1 parent 81a3824 commit db672c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/cmd/roachtest/tests/disk_stall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit db672c3

Please sign in to comment.