Skip to content

test(e2e): let database requests finish before the harness advances time - #1206

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/db-locked-warning
Oct 9, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/db-locked-warning

Conversation

@ZhuchkaTriplesix

@ZhuchkaTriplesix ZhuchkaTriplesix commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Why the warning appeared

CI logs show database has been locked for 0:00:10 eleven times in the smoke and command-palette e2e suites. sqflite prints it when a database operation waits on the lock for ten seconds.

Checked against the code:

  • The app opens one transaction, in LocalDb.updateConnection, and it uses the transaction object correctly. Nothing holds the lock for ten seconds.
  • The warnings come only from tests that call E2eAppHarness.close. It advances the fake clock in ten-second steps. A database request still in flight at that moment has its ten-second timer fire on the fake clock, so the warning appears although the real request is fine.

Changes

  • close lets the real requests finish (runAsync, 500 ms) before it advances the fake clock.

Not verified locally

Tests were not run locally, per the project rule. The expectation is that the warning disappears from the CI log. If it stays, the cause is not the harness and the investigation continues.

The harness closes an app by advancing the fake clock in 10 s steps. A database
request still in flight then trips sqflite's 10 s "database has been locked"
warning, eleven times per run in the smoke and palette suites. The app holds no
lock there, so the warning is noise: the harness now lets real requests finish
before it advances the fake clock.
@ZhuchkaTriplesix
ZhuchkaTriplesix force-pushed the issue/db-locked-warning branch from 87beec0 to 5a57138 Compare October 9, 2026 08:29
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 2bfb6d1 into dev Oct 9, 2026
14 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