Files
ngit-grasp/tests/sync
DanConwayDev 93f4cdec7c test: order replacement fixtures by explicit predecessors
Replacement fixtures must not depend on crossing a wall-clock second or
finding a lucky lower event ID. The same-second history test previously
searched up to 100,000 nonces against a random predecessor, which can still
fail when that predecessor has a sufficiently low ID.

Add checked timestamp advancement and a re-signing helper that preserves
fixture payloads and audit tags. Order recovery announcements after signed
deletion cutoffs, repeated announcements after their prior revision, and
recovery states after the parked announcement. Use explicit predecessor
ordering in sync invitation, ownership replacement and state-fetch tests;
remove sleeps whose only purpose was timestamp spacing. Preserve waits that
exercise hot-cache expiry and explicit history/conflict timestamps.

Return the original audit fixture's signed state through a companion helper
without changing its Git commit or existing callers. History revisions can
therefore follow that exact initial state. Build two nonce-bearing candidates
at one timestamp and sort their IDs to exercise larger-to-smaller replacement
and persistence across restart without mining. Document these fixture rules.

This changes test construction only. It does not change production event
ordering, introduce a shared clock, or import ngit's publishing/mining policy.
The caller remains responsible for supplying the relevant predecessor or
cutoff; timestamp overflow and signer changes fail explicitly.

Validation: recovery and replaceable-history suites, full ngit-grasp suite,
all-target workspace Clippy with warnings denied, formatting and diff checks.

Assisted-by: GPT-6
2026-09-17 15:12:02 +00:00
..