-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoC: Run E2E tests with WP Playground #62692
base: trunk
Are you sure you want to change the base?
Conversation
26f785c
to
f60c136
Compare
f60c136
to
5416734
Compare
@adamziel, many tests are failing because the database randomly disconnects, causing the app to throw 500 errors. I have yet to find a consistent way to reproduce the issue, but I'll continue working on it when I'm back (around July 2nd). Once this issue is resolved, the legit failures will provide valuable information on Playground's current limitations compared to wp-env. It's been nice to see how easy it is to circumvent wp-env. Spinning up the WP Playground instance is really fast, too. 💪 cc: @griffbrad @dmsnell |
FWIW for https://github.com/swissspidy/media-experiments I always use wp-now for running tests locally (as I can't use Docker) and I constantly run into the same issue with 500 errors. Curious to hear what you find out. |
@WunderBart @swissspidy are you using a MySQL connection or relying on SQLite when you get the 500s? How do we know it's a database disconnect? I didn't think that is possible with SQLite, and I wonder also if we're seeing concurrency issues with multiple requests? Mostly the Playground handles requests serially, but I think it should be fine with concurrent requests as well. |
Hmm I don't think it's a database issue in my case. Also no idea how to make it use MySQL, so I think it's just the default SQLite setup. Just did another test and it's actually more a timeout than a proper error 500. The server stops responding and in the terminal I get errors like this:
But I don't wanna hijack the discussion here :-) |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
890ed10
to
df7d403
Compare
bbc4e3a
to
5603487
Compare
5603487
to
1e0155b
Compare
The db disconnected is what's being thrown every time that 500 happens: @dmsnell @swissspidy @adamziel, I'm pretty sure it's a Playground memory leak / CI resources issue. It's not tied to any tests specifically and to any specific Playwright action (although Playwright might also be leaking 🤷). To confirm that, I tried running a smaller number of tests per job, and the ones that the suites usually fail at pass if run in smaller batches. For example, here are three iterations, each running more tests from the previous one, finally (consistently) failing at iteration 3:
FWIW, I did observe the server logs and they weren't any helpful. All the requests end with 200 until suddenly it's 500. It also seems to be related to what we're experiencing in Woo where we're running with I'm kinda out of ideas on how to debug this further, also because I need a break from this issue. 😅 Any help here would be much appreciated! 🙏 |
@wojtekn does that happen at all in Studio? |
@WunderBart wonderful explorations, thank you! Let's extract as much debug information as we can. A few ideas:
Also, are you running Also let's link this with this related issue: WordPress/wordpress-playground#1596 |
Thanks for the feedback, @adamziel!
I'm running with An example trace.zip isn't really that helpful - it just shows that the test fails at navigation or plugin activation because of the 500: The server logs around the 500 aren't that helpful either. Everything is peachy until a sudden 500 is thrown (tried with different PHP versions FWIW). Here's a snippet from around the error line:
Maybe I'm just missing something obvious there, though! 🤞 Do we have any DB experts in this context who could help inspect the issue from that side? 😅 |
What?
A simple PoC for running E2E tests against a Playground instance (instead of wp-env).
How?
npm install && npx playwright install
to install deps.npm run build
to build Gutenberg.node playground-server.js
to start the test env via Playground.WP_BASE_URL=http://127.0.0.1:9400/ npm run test:e2e
.