Skip to content

Fix E2E suite failing on expired admin email confirmation - #30

Merged
roborourke merged 1 commit into
mainfrom
fix/e2e-admin-email-confirmation-timebomb
Jul 27, 2026
Merged

Fix E2E suite failing on expired admin email confirmation#30
roborourke merged 1 commit into
mainfrom
fix/e2e-admin-email-confirmation-timebomb

Conversation

@roborourke

Copy link
Copy Markdown
Collaborator

Problem

The Playwright suite has been failing on main since 27 July, but nothing in the plugin code broke — the fixture hit a time bomb.

tests/e2e/database.sql bakes in a fixed admin_email_lifespan of 1785000678, which expired at 2026-07-25 17:31 UTC. Once that timestamp passed, WordPress began redirecting every admin login to its "verify your admin email" screen:

Location: .../wp-login.php?redirect_to=...&action=confirm_admin_email

That page has no #wpadminbar and isn't /wp-admin/, so the Promise.race in tests/e2e/global-setup.js:30 timed out. Global setup threw and the suite aborted before running a single test.

The timeline lines up exactly:

Last CI pass Jul 24 14:51 — before expiry
Fixture expiry Jul 25 17:31
First CI failure Jul 27 09:34 — after expiry

Both failing runs on main show the identical error at global-setup.js:32 ("Failed to log in to WordPress"), so this is unrelated to the code in #25 and #29 — those were simply the next pushes after the clock ran out.

Fix

Adds tests/mu-plugins/disable-admin-email-confirmation.php:

add_filter( 'admin_email_check_interval', '__return_zero' );

Core gates the redirect on $admin_email_check_interval > 0 && time() > $admin_email_lifespan (wp-login.php:1401), so returning 0 disables the check entirely — independent of whatever timestamp the fixture holds.

I chose the filter over rewriting the timestamp in database.sql deliberately: any new value would just re-arm the same bomb on a later date, and a fixture re-export would silently reintroduce it. tests/mu-plugins is already mapped to wp-content/mu-plugins for both the dev (8888) and test (8889) environments, and this follows the existing pattern of force-elasticpress-available.php.

Testing

  • Login now returns 302 → http://localhost:8889/wp-admin/ (was redirecting to confirm_admin_email).
  • Full suite passes locally: 22/22 in 2.1m.
  • admin_email_lifespan is the only expiring timestamp in the fixture — also grepped for transient timeouts, none present.

🤖 Generated with Claude Code

The database fixture bakes in a fixed `admin_email_lifespan` of 1785000678,
which expired on 2026-07-25 17:31 UTC. Past that point WordPress redirects
every admin login to `wp-login.php?action=confirm_admin_email`, which has no
`#wpadminbar` and is not `/wp-admin/`, so the Playwright global setup timed
out and the whole suite aborted before running a single test.

Disable the check via the `admin_email_check_interval` filter. Core gates the
redirect on `$admin_email_check_interval > 0 && time() > $admin_email_lifespan`,
so returning 0 suppresses it regardless of the stored option value.

Filtering rather than rewriting the timestamp in database.sql keeps this from
re-arming on a future date, and survives a fixture re-export.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Playwright test results

passed  22 passed

Details

stats  22 tests across 7 suites
duration  1 minute, 16 seconds
commit  8d7adec

@bucur-marian bucur-marian left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@roborourke
roborourke merged commit f59f1eb into main Jul 27, 2026
1 check passed
@roborourke
roborourke deleted the fix/e2e-admin-email-confirmation-timebomb branch July 27, 2026 15:01
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.

2 participants