From 440f9eff3cff3d7b0fc0708c06ecfb4d13a4a45c Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sun, 22 Nov 2026 09:26:58 -0800 Subject: [PATCH] test: the returning old host exits 75 on its old root and on a fresh root, and the unit restarts it Co-Authored-By: Claude Opus 5.5 --- .../procedure_gate_integration_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/seaweed-block/cmd/blockvolume/procedure_gate_integration_test.go b/seaweed-block/cmd/blockvolume/procedure_gate_integration_test.go index 2b65e12024..640bb67930 100644 --- a/seaweed-block/cmd/blockvolume/procedure_gate_integration_test.go +++ b/seaweed-block/cmd/blockvolume/procedure_gate_integration_test.go @@ -195,15 +195,16 @@ func TestProcedureForcedMoveWithTheOldHostReturning(t *testing.T) { t.Fatal("the block written after the last cut reads back on s2; the page says it is lost") } - // The old host returns with its old local root. It must not take s2's - // line as its own (a holder is server and replica), report its frontend - // ready or listen for I/O; it logs a refusal and exits with status 78, the - // no-restart class for a local root older than HEAD (the example unit - // does not restart on 78). Started again by hand, it does the same. - back := env.oldHostRefuses(t, "blockvolume-s1-back", env.hosts["s1"], e2, 78) - again := env.oldHostRefuses(t, "blockvolume-s1-started-again", env.hosts["s1"], e2, 78) + // The old host returns with its old local root, and the example unit + // (Restart=on-failure, RestartSec=5s) starts it again after it exits, + // until its start limit. Each time it must not take s2's line as its own + // (a holder is server and replica), report its frontend ready or listen + // for I/O; it logs a refusal and exits with status 75. + back := env.oldHostRefuses(t, "blockvolume-s1-back", env.hosts["s1"], e2, 75) + time.Sleep(5 * time.Second) // RestartSec of the example unit + again := env.oldHostRefuses(t, "blockvolume-s1-restarted", env.hosts["s1"], e2, 75) // Control: on a fresh local root there is no stale root, so its refusal - // is the identity check alone; it exits 75, the retry class. + // is the identity check alone; it also exits 75. fresh := env.hosts["s1"] fresh.root = fresh.root + "-fresh" freshRoot := env.oldHostRefuses(t, "blockvolume-s1-fresh-root", fresh, e2, 75)