Add CRDT clock and convergence coverage - #93
Conversation
Covers the library's central correctness claims that had no direct tests: - HybridDateTimeProvider clock logic (backward/equal wall clock -> reuse timestamp and bump counter; TakeLatestTime advancing past synced commits). The rest of the suite injects a MockTimeProvider that stubs this out. - HybridDateTime comparison operators and counter tie-break on equal instants. - Concurrent edits to the same entity converge to a single deterministic winner across both replicas (same-instant tie-break and later-timestamp-wins). - SyncWith idempotency (a second sync transfers nothing) and the ShouldSync/IsSynced short-circuit via NullSyncable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 56 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
|
@coderabbitai review |
|
AI-generated summary
Adds direct coverage for the CRDT correctness guarantees that previously had none — the second batch from the test-suite review.
Hybrid clock (
HybridDateTimeProviderTests, new file). Every other test injects aMockTimeProviderthat stubs out the real clock logic, soHybridDateTimeProviderhad zero coverage. New tests use a settableTimeProviderto exercise:TakeLatestTimeadvances local time past the newest received commit and ignores older ones.HybridDateTimeordering (HybridDateTimeTests). Added the comparison operators (<,>,<=,>=) and the counter tie-break on equal instants, which drive the clock's counter-increment decision and were untested.Sync convergence (
SyncTests). Existing multi-client tests only edited different entities or the same entity with strictly-increasing timestamps, so the tie-break path never ran. Added:SyncWithidempotency (a second sync transfers nothing);ShouldSync/IsSyncedshort-circuit viaNullSyncable(IsSyncedwas never asserted anywhere before).Test-only; no production code changed.
Test plan
dotnet teston the affected tests passes (23/23 locally, including pre-existingHybridDateTimeTests).