diff --git a/seaweed-block/cmd/sw-block/volume_backup_test.go b/seaweed-block/cmd/sw-block/volume_backup_test.go index dee76cf062..c5081e69ac 100644 --- a/seaweed-block/cmd/sw-block/volume_backup_test.go +++ b/seaweed-block/cmd/sw-block/volume_backup_test.go @@ -487,7 +487,7 @@ func TestVolumeBackupTakesOneSnapshotAndRerunReplays(t *testing.T) { // answer lost or unknown: the failure names the same command; running it // completes with exactly one snapshot. func TestVolumeBackupInterruptedResumesWithTheSameCommand(t *testing.T) { - for _, c := range []string{"step", "lost", "unknown"} { + for _, c := range []string{"step", "lost", "unknown", "refuse"} { t.Run(c, func(t *testing.T) { h := newFakeHost(t) env := h.env(t) @@ -504,7 +504,11 @@ func TestVolumeBackupInterruptedResumesWithTheSameCommand(t *testing.T) { sh.mode = c } code, _, errs := runBackup(env, "vol-a", "--name", "nightly") - if code != 1 || !strings.Contains(errs, "run the same command") || !strings.Contains(errs, "sudo sw-block volume backup vol-a --name nightly") { + wantCode := 1 + if c == "refuse" { + wantCode = 2 + } + if code != wantCode || !strings.Contains(errs, "run the same command") || !strings.Contains(errs, "sudo sw-block volume backup vol-a --name nightly") || !strings.Contains(errs, "keeps what it uploaded") { t.Fatalf("interrupted backup: %d %s", code, errs) } env.Step, sh.mode = nil, "" diff --git a/seaweed-block/cmd/sw-block/volume_verbs_test.go b/seaweed-block/cmd/sw-block/volume_verbs_test.go index 92974b1fe3..b910ebd9d5 100644 --- a/seaweed-block/cmd/sw-block/volume_verbs_test.go +++ b/seaweed-block/cmd/sw-block/volume_verbs_test.go @@ -685,7 +685,7 @@ func TestVolumeStopPrintsTheTimeTakenBeforeTheCut(t *testing.T) { func TestVolumeTextsForTimeoutsAndNewVolumes(t *testing.T) { h, env := startedHost(t, true) h.cutMode.Store("hang") - if _, _, errs := runStop(env, stopOpts{Volume: "vol-a", Timeout: 100 * time.Millisecond}); !strings.Contains(errs, "keeps what it uploaded") { + if _, _, errs := runStop(env, stopOpts{Volume: "vol-a", Timeout: 100 * time.Millisecond}); !strings.Contains(errs, "keeps what it uploaded") || !strings.Contains(errs, "running the same command again continues from it") { t.Fatalf("timed-out cut: %s", errs) } if !strings.Contains(volumeHelp(), "cluster spec and restart blockmaster") {