everysync: clear shared store keys before cursor and baseline test (150 tests)
- Commit
9444a457565e26f0955ba0b316e53f7dcf8ca935- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-15 19:17 UTC (20 days ago)
- Parents
82c6f97
syncStateAndCursorAndBaseline failed in CI with 'expected 10 was 0' at the relay cursor read-back. Two causes: RelayCursorStore.get reads the DataStoreUtils synchronous mirror right after the suspending set (the mirror lagged under load; fixed at the root in the library commit), and the initial-state assertions (cursor 0, empty baseline) observed whatever earlier test classes in the same JVM had left in the shared store under those keys. Clear the sync-state, cursor and baseline keys at the start of the test so it is independent of class order. No assertion changed. Verified green 3x under TZ=UTC and TZ=America/New_York.
Diff
everysync/src/test/java/com/vayunmathur/everysync/StoresAndHelpersTest.kt
diff --git a/everysync/src/test/java/com/vayunmathur/everysync/StoresAndHelpersTest.kt b/everysync/src/test/java/com/vayunmathur/everysync/StoresAndHelpersTest.ktindex 9c6078c0c2..36e6d06f61 100644--- a/everysync/src/test/java/com/vayunmathur/everysync/StoresAndHelpersTest.kt+++ b/everysync/src/test/java/com/vayunmathur/everysync/StoresAndHelpersTest.kt@@ -52,6 +52,12 @@ class StoresAndHelpersTest { assertEquals("lww", Settings.CONFLICT_LWW) } @Test fun syncStateAndCursorAndBaseline() = runBlocking {+ // The store is shared with every other everysync test class in this+ // JVM: clear the keys under test so the initial-state assertions do+ // not depend on class order.+ SyncState.set(ctx, "acc", "scope", null)+ RelayCursorStore.clearVault(ctx, "notes", "v1", listOf("chan"))+ VaultBaseline.clearVault(ctx, "v1", listOf("todo")) assertNull(SyncState.get(ctx, "acc", "scope")) SyncState.set(ctx, "acc", "scope", "42"); assertEquals("42", SyncState.get(ctx, "acc", "scope")) SyncState.set(ctx, "acc", "scope", null); assertNull(SyncState.get(ctx, "acc", "scope"))