Skip to content

Commit 2f8cdf6

Browse files
dzhelezovclaude
andcommitted
test(chaos): strengthen K2 reconnect guard to full deepEqual (committee nit)
All three review seats (reviewer/codex/glm-standin) independently flagged that the K2 reconnect test asserted only the first block + contiguity, weaker than test 1's full-sequence deepEqual. Pin the exact window [300, 301, 302] so the guard also catches a wrong count / truncated stream, symmetric with test 1. Re-verified: baseline 14/14 green; pre-#169 mutation (loop off shared streamCursor) still fails both new tests; revert clean; biome 2.5.2 clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 671a926 commit 2f8cdf6

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

harness/chaos/realtime/mock-portal.test.mjs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,12 @@ test('handleBlocks: a /stream reopened at a fresh fromBlock mid-flight starts at
481481

482482
const reconnectSeq = streamedNumbers(resReconnect);
483483

484-
// The reconnect must begin at its own fromBlock and stay contiguous — never inherit the in-flight
485-
// stream's cursor position.
486-
assert.equal(
487-
reconnectSeq[0],
488-
300,
489-
`reconnect started at ${reconnectSeq[0]}, expected its own fromBlock 300; full sequence ${JSON.stringify(
490-
reconnectSeq,
491-
)}`,
492-
);
484+
// Sanity: the reconnect streamed its full window off its OWN fromBlock (guards against a vacuous
485+
// pass where it emitted nothing/too few and "contiguity" held trivially). Under the shared cursor
486+
// it would inherit the in-flight stream's position instead of honoring fromBlock 300.
487+
assert.deepEqual(reconnectSeq, [300, 301, 302]);
488+
489+
// The load-bearing property: the reconnect begins at its own fromBlock and stays contiguous —
490+
// never inherits the in-flight stream's cursor position.
493491
assertContiguous(reconnectSeq, 'reconnect (fromBlock=300)');
494492
});

0 commit comments

Comments
 (0)