From f19a44f264d9c5a43ae14d778f97b193c914c5e8 Mon Sep 17 00:00:00 2001 From: Daniel Netzer Date: Tue, 27 Oct 2026 23:36:47 +0200 Subject: [PATCH] test(ui): wait for the run job before counting engine calls in sync_render_test.go (macOS race) (#280) --- lab/internal/ui/sync_render_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lab/internal/ui/sync_render_test.go b/lab/internal/ui/sync_render_test.go index 0512f41..69f3edc 100644 --- a/lab/internal/ui/sync_render_test.go +++ b/lab/internal/ui/sync_render_test.go @@ -269,6 +269,7 @@ func TestSyncRenderStartIntakeRefusedWhenTheIssueClosedMeanwhile(t *testing.T) { } // An open Issue starts. viewOf[RunJobView](t, do(t, h, gatePost("/api/runs", `{"issue":9}`)), http.StatusAccepted) + waitJob(t, h, runKey(9)) if n := d.calls(); n != 1 { t.Fatalf("an open Issue did not start: %d engine calls", n) } @@ -309,6 +310,7 @@ func TestSyncRenderStartIntakeEnforcesTheStartableRule(t *testing.T) { } // A row the Issues view shows startable starts. viewOf[RunJobView](t, do(t, h, gatePost("/api/runs", `{"issue":5}`)), http.StatusAccepted) + waitJob(t, h, runKey(5)) if n := d.calls(); n != 1 { t.Fatalf("row 5 did not start: %d engine calls", n) } @@ -380,6 +382,7 @@ func TestSyncRenderStartIntakeNeedsASnapshotFromAfterItBegan(t *testing.T) { // Same clock: the forced read is from after the start and Issue 1 starts. h.(*handler).forge.now = clk.now viewOf[RunJobView](t, do(t, h, gatePost("/api/runs", `{"issue":1}`)), http.StatusAccepted) + waitJob(t, h, runKey(1)) if n := d.calls(); n != 1 { t.Fatalf("a current read did not start: %d engine calls", n) }