on main help sign in
fix(tests): fix flaky async windows test
commit66795b1ec57abeef4ecff1f4cf3e8b040687427c authorKieran Klukas <kieran@dunkirk.sh> dateFri 22 May 2026, 17:26 (5 months ago) parent5572165
1 file changed+2−6
internal/shell/background_test.go+2−6
internal/shell/background_test.go+2−6
@@ -128,12 +128,8 @@ func TestBackgroundShell_IsDone(t *testing.T) {
128128 t.Fatalf("failed to start background shell: %v", err)
129129 }
130130
131− // Wait a bit for the command to complete
132− time.Sleep(100 * time.Millisecond)
133−
134− if !bgShell.IsDone() {
135− t.Error("expected shell to be done")
136− }
131+ // Wait for the command to complete (Windows is slower to spin up).
132+ require.Eventually(t, bgShell.IsDone, 5*time.Second, 50*time.Millisecond, "expected shell to be done")
137133
138134 // Clean up
139135 manager.Kill(bgShell.ID)