Rayrun
← Back to Discord Forum

Tests work locally but get stuck in CI

Hello all

I've been recently tasked with rewriting our end to end tests. One of the changes I made was to use Playwright to launch the development server instead of doing this manually. This works fine locally and all my tests pass - however the moment I get into GitHub Actions the tests get stuck with no errors.

Any idea why this might be? Any way I can actually debug this? I tried to use DEBUG=pw:api and DEBUG=pw:webserver with no luck.

image.png

This thread is trying to answer question "Why do tests using Playwright work locally but get stuck when run on GitHub Actions and how can this be debugged?"

11 replies
tphillips8117

How long do the tests take to run?

tphillips8117

turn on test tracing too, to find out how far they get and what's happening

tphillips8117

I suspect though that your tests are taking too long and Github is cancelling the run

Oh boy am I familiar with this. 🙂 We're currently fighting this with something other than Playwright. The problem we're facing is that it happens inconsistently. I can tell you that you will not get anything useful out of GitHub with debug turned on; just a stack trace saying the operation was canceled.

I'd guess your tests aren't starting since there's no output after line 18. Do you have a timeout set in your workflow? Can you add steps to your actions that just output the current time so that you can see time elapsed?

Another possibility is that the runner is resource starved and runs out of memory.

This action allows you to ssh into the runner for debugging. We're about to add it to our workflow to try to figure out this problem. You might find it helpfull. You can ssh into the runner and see what it's up to. https://github.com/mxschmitt/action-tmate

@jennifer0419: This is super handy!

This is super handy!

@jennifer0419: I don't have a particular timeout for the workflow itself only the Playwright tests which never even hit their timeout setting. I'll likely add time outputs. Also gonna checkout tmate - thanks for that suggestion

I don't have a particular timeout for the workflow itself only the Playwright tests which never even hit their timeout setting. I'll likely add time outputs. Also gonna checkout tmate - thanks for that suggestion

jennifer0419
jennifer0419

I'm glad that helps! I'll let you know if I have feedback on using tmate.

This issue may have been some weird interaction with turborepo. I noticed that when I didn’t use the command through turbo it would run successfully but when I did the tests would hang at a waitForRequest call

Looked like it indicated that the server was down

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].