on main help sign in
fix(tests): fix flaky async windows test
66795b1Kieran Klukas
internal/shell/background_test.go+2−6
@@ -128,12 +128,8 @@ func TestBackgroundShell_IsDone(t *testing.T) {
128 t.Fatalf("failed to start background shell: %v", err)
128 t.Fatalf("failed to start background shell: %v", err)
129 }
129 }
130
130
131− // Wait a bit for the command to complete
131+ // Wait for the command to complete (Windows is slower to spin up).
132− time.Sleep(100 * time.Millisecond)
132+ require.Eventually(t, bgShell.IsDone, 5*time.Second, 50*time.Millisecond, "expected shell to be done")
133−
134− if !bgShell.IsDone() {
135− t.Error("expected shell to be done")
136− }
137
133
138 // Clean up
134 // Clean up
139 manager.Kill(bgShell.ID)
135 manager.Kill(bgShell.ID)