From 1c7e77f094f2db0098d737e63cf600b15c9deb3f Mon Sep 17 00:00:00 2001 From: yaruk-byte Date: Thu, 17 Sep 2026 09:44:05 -0700 Subject: [PATCH] tstest/integration: wait longer to remove the staged binaries at teardown (#21207) The Windows GitHub runners' provisioning daemon, provjobd.exe, opens a handle to each freshly-written tailscaled.exe. tb.TempDir's own cleanup retries for a fixed 2s and gives up, failing whichever test happens to tear down while the handle is held. Updates #21099 Signed-off-by: Yaruk Asghar --- tstest/integration/integration.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tstest/integration/integration.go b/tstest/integration/integration.go index ffebe7717..baf4e0b98 100644 --- a/tstest/integration/integration.go +++ b/tstest/integration/integration.go @@ -172,6 +172,13 @@ func (b BinaryInfo) writeCopy(path string) error { // It fails tb if the build or binary copies fail. func GetBinaries(tb testing.TB) *Binaries { dir := tb.TempDir() + // Working around an issue with GitHub runners where provjobd.exe can keep files + // open for longer than the 2s tb.TempDir's own cleanup allows. See #21099. + tb.Cleanup(func() { + if err := tstest.WaitFor(60*time.Second, func() error { return os.RemoveAll(dir) }); err != nil { + tb.Logf("removing %s: %v", dir, err) + } + }) buildOnce.Do(func() { buildErr = buildTestBinaries(dir) })