Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/lineage-reconcile-boot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,18 @@ test("AC12: a multi-hop grandchild stays eligible when its intermediate parent h
s.state.blocks.length = 0;
delete s.metadata.derivedBlocksAdopted;
}
// The scenario under test needs the sweep to reach the grandchild
// BEFORE the child adopts. listSessions() orders by lastSeen desc, and
// the two turns' timestamps are ambient wall-clock: a coarse clock or
// a reload path restamping lastSeen can tie or flip them (observed
// deterministically on the windows-latest CI lanes). Once the child is
// visited first it legitimately adopts from the root, and the
// grandchild's adoption from a now-block-bearing parent is CORRECT
// behavior (#2807 contract) — failing this assertion for the wrong
// reason. Pin the order instead of leaning on clock luck.
const pinnedChild = listSessions().find((x) => x.id === childId)!;
const pinnedGrandchild = listSessions().find((x) => x.id === grandchildId)!;
pinnedGrandchild.lastSeen = Math.max(pinnedGrandchild.lastSeen, pinnedChild.lastSeen + 60_000);
} finally {
await close(proxy);
await close(relay);
Expand Down
Loading