Skip to content

Conversation

@stevensJourney
Copy link
Collaborator

@stevensJourney stevensJourney commented Nov 13, 2025

This started out as updating the should not report fetching status Web Watched query test - then it progressed some some general Node.js test stability improvements. The changes here should increase the stability of tests, but I don't believe they are 100% stable yet.

For should not report fetching status: That tests was inherently flawed. The powerSync.query(...).watch(...) API requires a comparator option in order to limit result emissions. We didn't supply one, so it's a wonder that test passed at all.

For Node.js: The main change there is to use a separate db for each mockSyncServiceTest. I found at least one test where the CRUD upload lock was held by another test which timed another test out. Separating the tests should increase their stability.

The mocked sync service uses the HTTP fetch method to create a manually controlled stream. I found numerous Stream Reader The reader is not attached to a stream error logs between tests. I believe this log probaby caused a retry delay which timed tests out. Some minor improvements to the closing of HTTP streams have been implemented in AbstractRemote to mitigate this.

Some of the log interceptor tests were also failing due to not detecting certain log messages. I'm not sure how these tests passed in the current code-base since the intercepted logger was not passed to the PowerSync database constructor.

@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2025

🦋 Changeset detected

Latest commit: f3c4df7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@powersync/common Patch
@powersync/adapter-sql-js Patch
@powersync/node Patch
@powersync/op-sqlite Patch
@powersync/react-native Patch
@powersync/tanstack-react-query Patch
@powersync/web Patch
@powersync/diagnostics-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@stevensJourney stevensJourney changed the title chore: fix racy web watch test chore: Improve racy tests Nov 13, 2025
@stevensJourney stevensJourney marked this pull request as ready for review November 13, 2025 13:09
@stevensJourney stevensJourney merged commit 66218b2 into main Nov 13, 2025
9 of 10 checks passed
@stevensJourney stevensJourney deleted the fix-racy-watch-test branch November 13, 2025 14:07
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.

3 participants