Build/Test Tools: Fix install.test.js leaving behind wp_e2e_ tables that break subsequent test runs - #13302
Build/Test Tools: Fix install.test.js leaving behind wp_e2e_ tables that break subsequent test runs#13302anamwp wants to merge 2 commits into
Conversation
…es that break subsequent test runs.
`afterEach` reverted `wp-config.php`'s table prefix but never dropped the
`wp_e2e_*` tables the test's own install wizard creates, so any run after
the first found a pre-existing install and never reached the installer.
Also retries the initial navigation itself, since a single `page.goto('/')`
right after the config swap can occasionally observe a stale config on
some hosts.
See https://core.trac.wordpress.org/ticket/65982
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
…stant. Per review feedback on the Trac ticket, avoid repeating the `wp_e2e_` literal in both the config rewrite and the cleanup query — use one `TEST_TABLE_PREFIX` constant instead so the two can't drift out of sync. See https://core.trac.wordpress.org/ticket/65982
|
Pushed a follow-up commit extracting wp_e2e_ into a single TEST_TABLE_PREFIX constant. Discussion continues on the Trac ticket. |
afterEach in tests/e2e/specs/install.test.js reverted wp-config.php's table prefix but never dropped the wp_e2e_* tables the test's own install wizard creates. As a result:
This PR:
Testing
Isolation data — three consecutive runs of each variant, with wp_e2e_* tables dropped before each:
Both changes are independently necessary — neither one alone is sufficient to make the test reliably repeatable.
Trac ticket: https://core.trac.wordpress.org/ticket/65982
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5
Used for: Diagnosing the root cause (including tracing a Playwright network trace and DB state to rule out a false lead), drafting the fix, and building the A/B isolation harness used to produce the testing data above. I reviewed the diagnosis, ran and verified the fix and the isolation tests myself, and take responsibility for the change.