Skip to content

Give the SQLCipher-heavy test suites room on Windows CI - #460

Merged
tomcardoso merged 1 commit into
mainfrom
fix/windows-crypto-test-timeouts
Jul 20, 2026
Merged

Give the SQLCipher-heavy test suites room on Windows CI#460
tomcardoso merged 1 commit into
mainfrom
fix/windows-crypto-test-timeouts

Conversation

@tomcardoso

Copy link
Copy Markdown
Owner

Unblocks the v0.2.0 release build, which failed on Windows with two rekeySharedDb tests timing out at the 5s default.

Diagnosis

This is contention, not a regression — and specifically not caused by the dependency bumps in #458:

v0.1.18 v0.2.0
Linux shared-db.test.ts 279ms 170ms — faster
Windows shared-db.test.ts 3153ms 15283ms
Windows database-snapshot.test.ts 4405ms (new)
Windows settings-theme.test.ts 25ms 18ms — unchanged

Unrelated Windows suites are unchanged, which rules out an unoptimized native build or a node-gyp/toolchain regression — those would have slowed everything touching SQLite.

The real cause: shared-db.test.ts was already running at ~3.1s on Windows against a 5s per-test ceiling — latent fragility that happened to fit. database-snapshot.test.ts, which I added for #437, builds a real file-backed encrypted database and snapshots it four times over (4.4s on Windows), and vitest runs test files in parallel. That extra crypto and I/O load pushed the rekey tests over the limit.

So the trigger was my own test file from the backup-snapshot work.

Fix

An explicit 30s timeout on the two affected suites, with comments explaining why they're legitimately slow. Rekeying re-encrypts every page and re-runs PBKDF2-HMAC-SHA512; the snapshot suite does full KDF plus migrations per test. These are real costs, not hangs.

Scoped to those two suites rather than raised globally, so the 5s default stays a meaningful signal everywhere else.

The underlying process gap

ci.yml runs ubuntu-only. Windows and macOS are exercised only by the release workflow, so platform-specific failures are guaranteed to surface as broken releases rather than failed PRs. This would have been caught on #459.

Not addressed here — adding Windows to CI would roughly triple CI minutes and is worth deciding deliberately. Worth filing as an issue.

Testing

npm test 531 passing, npm run typecheck clean — both on macOS. Windows timing can't be reproduced locally, so the real verification is the next release build.

Two rekeySharedDb tests timed out at the 5s default during the v0.2.0
release build. The cause is contention, not a regression: Linux got
faster over the same range (279ms -> 170ms) and unrelated Windows suites
were unchanged, so this is not an unoptimized native build.

shared-db.test.ts was already running at ~3.1s on Windows against a 5s
per-test ceiling. database-snapshot.test.ts, added for #437, builds a
real file-backed encrypted DB and snapshots it four times over (~4.4s on
Windows) and runs in parallel with it, which pushed the rekey tests past
the limit.

Both operations are legitimately expensive - rekeying re-encrypts every
page and re-runs PBKDF2-HMAC-SHA512 - so the timeout is raised for those
two suites only rather than globally, keeping the 5s default as a real
signal everywhere else.

Note: ci.yml runs ubuntu-only, so Windows is exercised only at release
time. This class of failure will keep surfacing during releases until
that changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tomcardoso
tomcardoso merged commit 663da06 into main Jul 20, 2026
1 check passed
@tomcardoso
tomcardoso deleted the fix/windows-crypto-test-timeouts branch July 20, 2026 18:01
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