From e428b05224d2d9ed82b20f719bb06407b8b45a27 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 9 Aug 2026 21:59:25 -0700 Subject: [PATCH] test: let the vacuum shell session outlive the vacuum (#10682) --- test/vacuum/vacuum_integration_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/vacuum/vacuum_integration_test.go b/test/vacuum/vacuum_integration_test.go index 6d7d14585..0d0c8e1c5 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)