From 66795b1ec57abeef4ecff1f4cf3e8b040687427c Mon Sep 17 00:00:00 2001 From: Kieran Klukas Date: Fri, 22 May 2026 17:26:41 -0400 Subject: [PATCH] fix(tests): fix flaky async windows test --- internal/shell/background_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/shell/background_test.go b/internal/shell/background_test.go index 9926fb1fd94241d1ea8a2411a8a570c0a1018386..063f5c31b3daaf3f75fc7a99604561cfcad07f9c 100644 --- a/internal/shell/background_test.go +++ b/internal/shell/background_test.go @@ -128,12 +128,8 @@ func TestBackgroundShell_IsDone(t *testing.T) { t.Fatalf("failed to start background shell: %v", err) } - // Wait a bit for the command to complete - time.Sleep(100 * time.Millisecond) - - if !bgShell.IsDone() { - t.Error("expected shell to be done") - } + // Wait for the command to complete (Windows is slower to spin up). + require.Eventually(t, bgShell.IsDone, 5*time.Second, 50*time.Millisecond, "expected shell to be done") // Clean up manager.Kill(bgShell.ID)