Skip to content

test: wait on the clock in sync service tests - #64

Merged
cyenite merged 1 commit into
mainfrom
fix/sync-test-wait
Nov 6, 2026
Merged

cyenite merged 1 commit into
mainfrom
fix/sync-test-wait

Conversation

@cyenite

@cyenite cyenite commented Nov 6, 2026

Copy link
Copy Markdown
Owner

The v1.1.0 release build failed twice on Windows in electron/sync-service.test.ts, in different tests each time: the pairing test saw choosingRepository instead of pairing, then a rerun saw syncing instead of idle and a missing reconnect prompt.

Cause

The test helper until() gave up silently after 20,000 setImmediate turns. On the Windows release runner sign-in and sync runs had not finished by then, so tests went on early. In the pairing test the sign-in finishing afterwards set the phase back to choosingRepository. Test-only: in the app a repository cannot be chosen before sign-in has listed them.

Fix

until() waits against a 10 second wall-clock deadline and throws when it passes, so a wait that is too slow fails at the wait rather than in a later assertion.

Testing

  • All 108 sync tests pass locally; none hit the deadline, so no test relied on the silent give-up.
  • Electron typecheck passes.

until() gave up silently after 20,000 event-loop turns. On the Windows
release runner sign-in and sync runs had not finished by then, so tests
went on early: the pairing test chose a repository before sign-in ended
and was reset to choosingRepository, and others saw sync still running.
Wait up to 10 seconds of wall-clock time and throw when that passes, so
a slow wait fails where it happens.
@cyenite
cyenite merged commit 837792c into main Nov 6, 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