NagyZoltanPeter f097c1d19d
tests(store-sync): fix flaky reconciliation test on macOS by anchoring timestamps to a fixed baseTime and aligning sync window via offset
Root cause:
- Separate calls to getNowInNanosecondTime() for test message timestamps and sync window boundaries led to mismatched ranges on slower macOS runs.
- This caused in-window messages to be miscategorized as out-window, producing assertion failures (e.g., remoteNeeds.len==0 while diffInWin==18).

Fix:
- Introduce a single fixed baseTime at test start and construct all message timestamps relative to it.
- Define the intended sync window as [baseTime - 1s, baseTime] and compute the reconciliation offset so effective now equals baseTime (offset = actualNow - baseTime).
- Place in-window messages safely inside the window with 50ms margins, and out-window messages well before the window to avoid overlap.
- Use consistent int64 timestamp arithmetic.

Result:
- The test is deterministic and passes reliably on macOS; eliminates the timing race. Recommend running CI matrix (macOS + Ubuntu) to confirm cross-platform stability.
2025-10-08 18:09:05 +02:00
..