Skip to content

Test on Windows and macOS, await closing databases - #159

Merged
simolus3 merged 9 commits into
mainfrom
test-on-windows-and-macos
Aug 27, 2026
Merged

Test on Windows and macOS, await closing databases#159
simolus3 merged 9 commits into
mainfrom
test-on-windows-and-macos

Conversation

@simolus3

Copy link
Copy Markdown
Contributor

This expands native Dart VM tests to also run on macOS and Windows (previously we only tested this package on Ubuntu). Testing on Windows adds an implicit assertion that we clean up all database resources before a test is complete: Deleting files or directories that still have opened file handles fails on Windows.

To get tests to work on Windows, this closes test databases before we get to the tearDown deleting database files. This requires two fixes:

  1. In NativeSqliteDatabaseImpl.close(), actually wait for all connections to be closed. To ensure no concurrent lease is active, we request exclusive access to the pool and only complete the future once everything is closed. Additionally, we now wait for worker isolates to have shut down.
  2. On the web, still using a database that has been closed can trigger worker errors as it's trying to find a database handle that no longer exists. This is arguably something that should be improved in sqlite3_web, but this patches tests to stop using the database before returning.

We don't run web tests on other operating systems: We expect Chrome to behave the same on all platforms, so we can treat it as a single target and don't need to run those tests multiple times.

This is related to powersync-ja/powersync.dart#460.

AI use: I used Claude Code for GH actions changes.

@simolus3
simolus3 requested a review from rkistner August 27, 2026 15:19
@simolus3
simolus3 merged commit 92da2a0 into main Aug 27, 2026
8 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.

2 participants