diff --git a/seaweed-block/cmd/blockvolume/planned_handoff_integration_test.go b/seaweed-block/cmd/blockvolume/planned_handoff_integration_test.go index 35b6afb632..ecb21f52c9 100644 --- a/seaweed-block/cmd/blockvolume/planned_handoff_integration_test.go +++ b/seaweed-block/cmd/blockvolume/planned_handoff_integration_test.go @@ -773,8 +773,9 @@ func poll(t *testing.T, timeout time.Duration, what string, fn func() bool) { // nvmeInitiator is the smallest NVMe/TCP host the test needs: one admin and // one IO queue, Write, Flush and Read of namespace 1. It runs in the test // process, so the test needs neither root nor the kernel's nvme_tcp. -// nvmeIODeadline bounds the NVMe initiator's connections. A var only so a -// test can shorten it. +// nvmeIODeadline bounds each NVMe command of the initiator: it is set at dial +// and renewed before every I/O command, so a long read loop on a slow host is +// not bounded as a whole. A var only so a test can shorten it. var nvmeIODeadline = 60 * time.Second type nvmeInitiator struct { @@ -844,6 +845,7 @@ func nvmeResponse(t *testing.T, r *nvme.Reader) nvme.CapsuleResponse { } func (c *nvmeInitiator) ioCmd(op uint8, lba uint64, blocks int) nvme.CapsuleCommand { + _ = c.io.SetDeadline(time.Now().Add(nvmeIODeadline)) c.cid++ cmd := nvme.CapsuleCommand{OpCode: op, CID: c.cid, NSID: 1} if blocks > 0 { diff --git a/seaweed-block/core/host/master/workspace_binding_review_test.go b/seaweed-block/core/host/master/workspace_binding_review_test.go index 8bcdb786e6..d27f1b96b5 100644 --- a/seaweed-block/core/host/master/workspace_binding_review_test.go +++ b/seaweed-block/core/host/master/workspace_binding_review_test.go @@ -43,7 +43,9 @@ func reviewBindingHostBeforeStart(t *testing.T, reader func(context.Context, str t.Fatal(e) } t.Cleanup(func() { c.Close() }) - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + // A hang guard for the whole test, not a performance bound: a slow host's + // setup must not use up the time its later calls need. + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) t.Cleanup(cancel) for _, server := range []string{"node-a", "node-b"} { if _, e = h.Lifecycle().Nodes.RegisterNode(lifecycle.NodeRegistration{ServerID: server, DataAddr: "127.0.0.1:9200", CtrlAddr: "127.0.0.1:9100"}); e != nil {