SLLS-546 Don't use system clocks in tests#708
Conversation
SummaryThis PR replaces system clock calls with fixed timestamps across test files to eliminate non-determinism and improve test reliability. Changes:
These changes ensure test behavior is consistent regardless of when tests are executed, making them more stable and faster (no ordering or timing dependencies). What reviewers should knowWhere to focus:
Key design decisions:
What to verify:
|
There was a problem hiding this comment.
LGTM! ✅
Clean, well-scoped PR. All Instant.now() and System.currentTimeMillis() usages in test files have been replaced — no remaining non-deterministic clock calls found.
One thing worth knowing for future work: ConnectedModeMediumTests uses a named constant (2026-01-01) instead of Instant.EPOCH. This is intentional — the same timestamp is threaded through both the initial pull response's queryTimestamp field and the changedSince=<value> query parameter in the incremental sync mock URL. The value needs to be self-consistent within each test, and a semantically meaningful named constant (CURRENT_TIME) makes the intent clearer than Instant.EPOCH. The codebase already uses Clock injection in LanguageClientLogger as the pattern for production-side time control; this PR correctly limits itself to the test side only.
|





No description provided.