Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

test: let the vacuum shell session outlive the vacuum (#10682)

Chris Lue428b05224d2
diff --git a/test/vacuum/vacuum_integration_test.go b/test/vacuum/vacuum_integration_test.go
index 6d7d14585a..0d0c8e1c5a 100644
--- a/test/vacuum/vacuum_integration_test.go
+++ b/test/vacuum/vacuum_integration_test.go
@@ -315,10 +315,15 @@ func TestVacuumIntegration(t *testing.T) {
}
commandEnv := shell.NewCommandEnv(options)
- shellCtx, shellCancel := context.WithTimeout(context.Background(), 60*time.Second)
+ // The session context outlives the vacuum command: a deadline here
+ // closes the master connection mid-command on a slow runner, and the
+ // leaked lock renewal then spins until the test binary's timeout.
+ shellCtx, shellCancel := context.WithCancel(context.Background())
defer shellCancel()
go commandEnv.MasterClient.KeepConnectedToMaster(shellCtx)
- commandEnv.MasterClient.WaitUntilConnected(shellCtx)
+ connectCtx, connectCancel := context.WithTimeout(shellCtx, 30*time.Second)
+ commandEnv.MasterClient.WaitUntilConnected(connectCtx)
+ connectCancel()
time.Sleep(2 * time.Second)
// Acquire lock (required by shell commands)