mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-16 04:06:44 +00:00
test: let the vacuum shell session outlive the vacuum (#10682)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user