Skip to content

Use 127.0.0.1 for the Playground E2E base URL so the login doesn't wait 30 seconds - #815

Merged
ilicfilip merged 1 commit into
developfrom
filip/e2e-login-host
Nov 26, 2026
Merged

ilicfilip merged 1 commit into
developfrom
filip/e2e-login-host

Conversation

@ilicfilip

Copy link
Copy Markdown
Collaborator

The Playground E2E login usually takes about 40 seconds instead of about 4. Pointing the tests at 127.0.0.1:8080 instead of localhost:8080 removes the 30-second wait.

Why: WordPress inside Playground uses 127.0.0.1:8080 as its address, while the tests used localhost:8080. global-setup.ts logs in once and saves the session to auth.json. When the first wp-admin request isn't auto-logged in yet, WordPress redirects to wp-login.php on 127.0.0.1. The password login then succeeds and lands on 127.0.0.1:8080/wp-admin/, but waitForURL(${baseURL}/wp-admin/**) waits for localhost. So it sits out the full 30-second timeout, waits 2 more seconds, and the retry succeeds.

This happens in most CI runs: 10 of the 12 most recent successful e2e-tests runs (October–November) took the password-and-retry path, with logins of 40–43 s where it hit the wait, against about 3 s when auto-login worked.

The auto-login itself is a race. Playwright starts as soon as Playground answers on the port, and the blueprint's "login": true applies a moment later. In the runs below, auto-login worked whenever Playground took 19 s or more to boot, and fell back to the password whenever it took 18 s or less. This PR doesn't change that. It makes the fallback fast (about 10 s) instead of slow (about 42 s).

Changes

  • playwright.config.ts: the default baseURL and the webServer.url use http://127.0.0.1:8080.
  • tests/e2e/global-setup.ts and tests/e2e/api/tasks.api.ts: the same default.
  • WORDPRESS_URL still overrides all of them, so the Docker-based Yoast Premium job is unchanged.

Verified

  • GitHub Actions on ubuntu-24.04, 5 runs each of develop (d5bb9236) and this change, one pair at a time, main e2e-tests job only:
    • all 10 runs passed, 15/15 tests each;
    • login: median 41.9 s on develop, 10.0 s with this change;
    • 30-second wait and retry: 3 of 5 runs on develop, 0 of 5 with this change;
    • whole job: median 250 s on develop, 206 s with this change.
  • Not covered: the Yoast Premium job. It sets WORDPRESS_URL itself, so this change doesn't affect it.

…it 30 seconds

WordPress inside Playground uses 127.0.0.1:8080 as its address. The tests used
localhost:8080, so when the first wp-admin request wasn't auto-logged in yet,
WordPress redirected to wp-login.php on 127.0.0.1, the password login landed on
127.0.0.1/wp-admin, and global-setup waited the full 30 s for a localhost URL
before retrying.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171WwmmGiPVRHC4CaxL76gc
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Test merged PR on Playground
Test this pull request on the Playground
or download the zip

@github-actions

Copy link
Copy Markdown
Contributor

✅ Code Coverage Report

Metric Value
Total Coverage 37.50% 📉
Base Coverage 37.50%
Difference 📈 0.00%

⚠️ Coverage below recommended 40% threshold

🎉 Great job maintaining/improving code coverage!

ℹ️ About this report
  • All tests run in a single job with Xdebug coverage
  • Security tests excluded from coverage to prevent output issues
  • Coverage calculated from line coverage percentages

@github-actions

Copy link
Copy Markdown
Contributor

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
10 0 10

⚠️ Warnings (10)

📁 classes/suggested-tasks/data-collector/class-unpublished-content.php (1 warning)
📍 Line 🔖 Check 💬 Message
103 WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information.
📁 classes/suggested-tasks/providers/class-content-review.php (4 warnings)
📍 Line 🔖 Check 💬 Message
232 WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information.
377 WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information.
381 WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information.
388 WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information.
📁 classes/activities/class-query.php (2 warnings)
📍 Line 🔖 Check 💬 Message
71 PluginCheck.Security.DirectDB.UnescapedDBParameter Unescaped parameter $table_name used in $wpdb->query()\n$table_name assigned unsafely at line 58.
163 PluginCheck.Security.DirectDB.UnescapedDBParameter Unescaped parameter $where_args used in $wpdb->get_results()\n$where_args assigned unsafely at line 153.
📁 classes/suggested-tasks/data-collector/class-yoast-orphaned-content.php (1 warning)
📍 Line 🔖 Check 💬 Message
111 PluginCheck.Security.DirectDB.UnescapedDBParameter Unescaped parameter $query used in $wpdb->get_row()\n$query assigned unsafely at line 98.
📁 classes/suggested-tasks/data-collector/class-terms-without-description.php (1 warning)
📍 Line 🔖 Check 💬 Message
108 PluginCheck.Security.DirectDB.UnescapedDBParameter Unescaped parameter $query used in $wpdb->get_results()\n$query assigned unsafely at line 106.
📁 classes/suggested-tasks/data-collector/class-terms-without-posts.php (1 warning)
📍 Line 🔖 Check 💬 Message
120 PluginCheck.Security.DirectDB.UnescapedDBParameter Unescaped parameter $query used in $wpdb->get_results()\n$query assigned unsafely at line 118.

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@ilicfilip
ilicfilip merged commit ede6b4e into develop Nov 26, 2026
22 checks passed
@ilicfilip
ilicfilip deleted the filip/e2e-login-host branch November 26, 2026 13:50
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