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 <[email protected]>
This commit is contained in:
yaruk-byte authored and GitHub committed 2026-09-17 09:44:05 -07:00
1 parent 408504af89
commit 1c7e77f094
1 file changed
+7
+7
View File
@@ -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)
})