Repository navigation
Use 127.0.0.1 for the Playground E2E base URL so the login doesn't wait 30 seconds - #815
Merged
Merged
Conversation
…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
Contributor
|
Test merged PR on Playground |
Contributor
✅ Code Coverage Report
🎉 Great job maintaining/improving code coverage! ℹ️ About this report
|
Contributor
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 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
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.
The Playground E2E login usually takes about 40 seconds instead of about 4. Pointing the tests at
127.0.0.1:8080instead oflocalhost:8080removes the 30-second wait.Why: WordPress inside Playground uses
127.0.0.1:8080as its address, while the tests usedlocalhost:8080.global-setup.tslogs in once and saves the session toauth.json. When the firstwp-adminrequest isn't auto-logged in yet, WordPress redirects towp-login.phpon127.0.0.1. The password login then succeeds and lands on127.0.0.1:8080/wp-admin/, butwaitForURL(${baseURL}/wp-admin/**)waits forlocalhost. 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-testsruns (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": trueapplies 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 defaultbaseURLand thewebServer.urlusehttp://127.0.0.1:8080.tests/e2e/global-setup.tsandtests/e2e/api/tasks.api.ts: the same default.WORDPRESS_URLstill overrides all of them, so the Docker-based Yoast Premium job is unchanged.Verified
ubuntu-24.04, 5 runs each ofdevelop(d5bb9236) and this change, one pair at a time, maine2e-testsjob only:develop, 10.0 s with this change;develop, 0 of 5 with this change;develop, 206 s with this change.WORDPRESS_URLitself, so this change doesn't affect it.