#66039 closed defect (bug) (duplicate)
E2E installation test rewrites the shared wp-config.php affecting following tests
| Reported by: | adrianmoldovanwp | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | tests |
Description
The root cause is only assumed, still needs confirmation.
tests/e2e/specs/install.test.js changes the table prefix in wp-config.php before each test, then restores the file after each test. All E2E tests share that file and the same site. PHP does not read the new file immediately, so a test can run against the previous configuration.
The php container reports opcache.revalidate_freq => 2 and opcache.validate_timestamps => On. PHP can therefore serve the old wp-config.php for up to two seconds after each write.
Two tests fail because of this:
install.test.jsopens the site before the new prefix is live. The site is still installed, so no redirect to the installer happens.media-upload.test.jslogs in before the restored prefix is live. The site is still uninstalled, so the login fails.
Both signatures appear in run 33745987034 on trunk:
1) install.test.js:34:6 › should install WordPress with pre-existing database credentials Error: should redirect to the installation page expect(page).toHaveURL(expected) failed Expected pattern: /wp-admin\/install\.php$/ Received string: "http://localhost:8889/" 14 × unexpected value "http://localhost:8889/"
2) media-upload.test.js:11:5 › Test dismissing failed upload works correctly
Error: apiRequestContext.get: 400 Bad Request
- → GET http://localhost:8889/wp-admin/admin-ajax.php?action=rest-nonce
- ← 400 Bad Request
Error: Not logged in
The failures are intermittent. In a sample of the five most recent trunk runs, every E2E job reported one or two flaky tests, and always these two. Playwright retries them, so the job still reports success and the problem stays hidden.
Expected: each test runs against the configuration written for it, and the suite reports a real result without retries.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #65982.