Skip to content

Commit 6aaca8c

Browse files
test(server): terminal checkout test waits for the refresh's last event
The test resolved on the first client state for the new branch and asserted right away, but the checkout refresh publishes a local update and then a remote update that both yield such a state. Whether the second one had landed depended on fiber scheduling, so CI saw [null, null] where it expected [null]. Wait for the remote update that ends the refresh and assert both states. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent fb2e5a0 commit 6aaca8c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/server/src/vcs/VcsStatusBroadcaster.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,10 @@ describe("VcsStatusBroadcaster", () => {
13601360
const next = applyGitStatusStreamEvent(clientStates.at(-1) ?? null, event);
13611361
clientStates.push(next);
13621362
yield* Deferred.succeed(subscribed, undefined);
1363-
if (next.refName === "repro") yield* Deferred.succeed(checkedOut, undefined);
1363+
// The refresh ends with the new branch's remote, after its local update.
1364+
if (event._tag === "remoteUpdated" && event.remote && next.refName === "repro") {
1365+
yield* Deferred.succeed(checkedOut, undefined);
1366+
}
13641367
}),
13651368
).pipe(Effect.forkScoped);
13661369
yield* Deferred.await(subscribed);
@@ -1375,7 +1378,7 @@ describe("VcsStatusBroadcaster", () => {
13751378

13761379
assert.deepStrictEqual(
13771380
clientStates.filter((status) => status.refName === "repro").map((status) => status.pr),
1378-
[null],
1381+
[null, null],
13791382
);
13801383
// A checkout must not trigger a network fetch.
13811384
assert.deepStrictEqual(state.remoteStatusRefreshUpstreamValues.slice(1), [false]);

0 commit comments

Comments
 (0)