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)