From 94e71642f9736effeb1f9f990572f800d04b9532 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 4 Nov 2025 10:20:12 -0800 Subject: [PATCH] fix: increase Windows filesystem delays in flaky tests - TestDaemonAutoImportAfterGitPull: 200ms -> 500ms for filesystem timestamp precision - TestSyncBranchPull_Success: 100ms -> 300ms for file I/O settling - Also increase Linux delays slightly for more reliability --- cmd/bd/daemon_autoimport_test.go | 6 +++--- cmd/bd/daemon_sync_branch_test.go | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/bd/daemon_autoimport_test.go b/cmd/bd/daemon_autoimport_test.go index 6348b439..36e0a8e4 100644 --- a/cmd/bd/daemon_autoimport_test.go +++ b/cmd/bd/daemon_autoimport_test.go @@ -134,11 +134,11 @@ func TestDaemonAutoImportAfterGitPull(t *testing.T) { // Wait for filesystem to settle after git operations // Windows has lower filesystem timestamp precision (typically 100ms) - // so we need a longer delay to ensure mtime comparison works + // and file I/O may be slower, so we need a longer delay if runtime.GOOS == "windows" { - time.Sleep(200 * time.Millisecond) + time.Sleep(500 * time.Millisecond) } else { - time.Sleep(50 * time.Millisecond) + time.Sleep(100 * time.Millisecond) } // Start daemon server in clone2 diff --git a/cmd/bd/daemon_sync_branch_test.go b/cmd/bd/daemon_sync_branch_test.go index 0a886c7f..2c87931b 100644 --- a/cmd/bd/daemon_sync_branch_test.go +++ b/cmd/bd/daemon_sync_branch_test.go @@ -563,9 +563,10 @@ func TestSyncBranchPull_Success(t *testing.T) { t.Error("JSONL not copied to main repo after pull") } - // On Windows, file I/O may need time to settle + // On Windows, file I/O may need more time to settle + // Increase delay significantly for reliable CI tests if runtime.GOOS == "windows" { - time.Sleep(100 * time.Millisecond) + time.Sleep(300 * time.Millisecond) } // Verify JSONL content matches