diff --git a/seaweed-block/core/storage/volume_unheld_test.go b/seaweed-block/core/storage/volume_unheld_test.go index 43014a98b6..7a23e26b7f 100644 --- a/seaweed-block/core/storage/volume_unheld_test.go +++ b/seaweed-block/core/storage/volume_unheld_test.go @@ -108,8 +108,9 @@ func TestProbeVolumeUnheldHolderProcessDies(t *testing.T) { t.Fatal(err) } exited := make(chan struct{}) - go func() { _ = cmd.Wait(); close(exited) }() // reaped on every path - t.Cleanup(func() { // kill the holder and join its reaper, bounded + // Reaped on every path; the cleanup kills the holder and joins its reaper. + go func() { _ = cmd.Wait(); close(exited) }() + t.Cleanup(func() { _ = cmd.Process.Kill() select { case <-exited: