[PHP] Default Playground SQLite journal mode to DELETE - #3909
Merged
Conversation
adamziel
force-pushed
the
adamziel/disable-sqlite-wal
branch
2 times, most recently
from
July 4, 2026 00:43
6516317 to
c6b325c
Compare
adamziel
force-pushed
the
adamziel/disable-sqlite-wal
branch
from
July 4, 2026 00:53
c6b325c to
6b03217
Compare
adamziel
marked this pull request as ready for review
July 4, 2026 01:14
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Defaults Playground’s SQLite journal mode to DELETE early in the request-handler boot path, and adds tests to verify the default and that explicit WAL is still honored.
Changes:
- Set a default
SQLITE_JOURNAL_MODE=DELETEinbootRequestHandler()unless the caller already provided it. - Update/add database tests to assert default
DELETEand explicitWAL.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/playground/wordpress/src/test/database.spec.ts | Adds assertions for default DELETE mode and explicit WAL override. |
| packages/playground/wordpress/src/boot.ts | Introduces early defaulting of SQLITE_JOURNAL_MODE during request-handler boot. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 4, 2026
adamziel
added a commit
that referenced
this pull request
Jul 7, 2026
## What it does Adds a CLI regression test for the SQLite failure mode reported in #3914. The test boots `@wp-playground/cli` with six workers, creates 11 custom tables through `dbDelta()`, then repeatedly sends publish-like, meta-box-loader-like, and post-list-like requests in parallel. The test fails if the flow returns WordPress database failure pages or if the final `PRAGMA integrity_check` does not return `ok`. ## Rationale The reported failure only appears under realistic concurrent editor load. A single CLI worker serializes requests too much, so this test intentionally uses multiple workers to exercise concurrent SQLite connections. This covers the corruption class from #3883/#3914 and protects the DELETE-journal-mode fix from #3909 plus the SQLite integration propagation fix in WordPress/sqlite-database-integration#447. ## Implementation The test writes a small set of PHP fixtures into the booted WordPress site: - setup: creates 11 custom tables with 11 `COMMENT`-bearing columns each - publish: inserts a post and rows into every custom table - meta-box-loader: reads counts and runs a wide joined custom-table query - post-list: runs a normal published-post `WP_Query` - integrity: checks `PRAGMA integrity_check` The stress test is skipped on Windows. The regression was reported on Linux CI and reproduced with non-Windows CLI workers; running the same multi-worker stress workload in the Windows CLI matrix hangs the affected target until the workflow timeout rather than producing useful signal. I confirmed the negative control locally: the same workload fails quickly when the CLI is booted with `SQLITE_JOURNAL_MODE=WAL`, producing `database disk image is malformed` / `Error establishing a database connection`. With the current DELETE default, it passes. ## Testing instructions ```bash npm exec nx run playground-cli:typecheck npm exec nx lint playground-cli npm exec nx run playground-cli:test-playground-cli -- --testFile=sqlite-concurrent-publish.spec.ts ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Defaults
SQLITE_JOURNAL_MODEtoDELETEbefore PHP instances run auto-prepended Playground code.Explicit callers can still opt into WAL with:
Rationale
Blueprint-defined constants are too late for this setting: the SQLite integration may already be loaded by the time Blueprint steps run. Defining
SQLITE_JOURNAL_MODEthroughbootRequestHandler()feeds the PHP auto-prepend path early enough.Implementation
Adds a request-handler boot default that only runs when the caller has not already provided
SQLITE_JOURNAL_MODE.Testing instructions
Run:
Note: the database test requires the refreshed SQLite integration bundle that includes WordPress/sqlite-database-integration#447. Against the current pre-refresh bundle, the new DELETE-mode assertion still reports
wal.