Skip to content

test(sync): stop the disconnect-lock test racing its own log - #181

Merged
pasichDev merged 1 commit into
masterfrom
fix/sync-test-race
Oct 5, 2026
Merged

pasichDev merged 1 commit into
masterfrom
fix/sync-test-race

Conversation

@pasichDev

Copy link
Copy Markdown
Owner

What

Makes SyncServiceTest.runWhileNoSyncRuns_waitsForTheSyncInFlightToFinish deterministic. The test now checks what the lock guarantees: the wipe runs only after the sync has applied its snapshot, and both log entries are present, in either order.

Why

The test recorded "sync finished" after the sync had already released the lock, so "cleared" could land first and the in-order assertion failed now and then. It stopped the 2.7.56 release build once; a rerun passed. The production code was right; the test raced its own log.

Testing

  • ./gradlew :app:testDebugUnitTest --tests "*SyncServiceTest" --rerun 5 times in a row: all pass.
  • ./gradlew :app:spotlessCheck: pass.

References

#170

runWhileNoSyncRuns_waitsForTheSyncInFlightToFinish recorded "sync
finished" after the sync had already let go of the lock, so the wipe
could log "cleared" first and the in-order check failed now and then.
It stopped the 2.7.56 release build once. The test now checks what the
lock guarantees: the wipe runs only after the sync has applied its
snapshot, and both entries are there, in either order.

Refs: #170
@pasichDev pasichDev self-assigned this Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Test coverage (unit + instrumentation)

Overall Project 17.97% 🍏

There is no coverage information present for the Files changed

@pasichDev
pasichDev merged commit d413515 into master Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant