From c5a21e507c22ce7dcfb24055d04403558569fbbf Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Fri, 23 Oct 2026 21:58:27 -0700 Subject: [PATCH] test: allow slow Restart Manager answers on Windows CI TestWindowsOpenFilesOwnedChild hit the 5 s inspection limit on a slow runner and blocked the v2026.10.13-alpha release. The test now allows 25 s; the production limit is unchanged. Claude-Session: https://claude.ai/code/session_01T2vtcW6ihn1ywy9vxUq9a4 --- internal/platform/files_rm.go | 5 ++++- internal/platform/files_windows_test.go | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/platform/files_rm.go b/internal/platform/files_rm.go index 4efd9386..91e63f72 100644 --- a/internal/platform/files_rm.go +++ b/internal/platform/files_rm.go @@ -12,9 +12,12 @@ import ( const ( rmFileLimit = 10000 rmBatchSize = 100 - rmTimeLimit = 5 * time.Second ) +// rmTimeLimit bounds one inspection. A variable so tests on slow CI runners, +// where Restart Manager can take seconds to answer, can allow more time. +var rmTimeLimit = 5 * time.Second + // restartManager is deliberately independent of the Windows ABI so bounded // enumeration and fail-closed behavior can be tested on every platform. type restartManager interface { diff --git a/internal/platform/files_windows_test.go b/internal/platform/files_windows_test.go index 588c5d71..486f741d 100644 --- a/internal/platform/files_windows_test.go +++ b/internal/platform/files_windows_test.go @@ -26,6 +26,9 @@ func TestRestartManagerOwnedFileHelper(t *testing.T) { } func TestWindowsOpenFilesOwnedChild(t *testing.T) { + limit := rmTimeLimit + rmTimeLimit = 25 * time.Second + t.Cleanup(func() { rmTimeLimit = limit }) dir := t.TempDir() name := filepath.Join(dir, "owned 子.txt") if err := os.WriteFile(name, []byte("owned"), 0600); err != nil {