Skip to content
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

v5.8.2 causes a hang in running a chrome browser test. #941

Closed
ssay-work opened this issue Jun 14, 2023 · 11 comments
Closed

v5.8.2 causes a hang in running a chrome browser test. #941

ssay-work opened this issue Jun 14, 2023 · 11 comments

Comments

@ssay-work
Copy link

Our chrome browser tests started hanging on version 5.8.2 which was released on 6/13

Cypress package version: 12.13.0
Cypress binary version: 12.13.0
Electron version: 21.0.0
Bundled Node version: 16.16.0

Updating our action to v5.8.1 fixed our problem.

@ghiscoding
Copy link

ghiscoding commented Jun 14, 2023

I also have the same problem using yarn classic and reverting to the previous version also works for me (thanks for that), it's probably caused by their last PR #914
I was horrified to see that my CI was still running after 1 hour being hanged on this problem 😲 😱

to add more info, here's my logs if it helps

Run cypress-io/github-action@v5
Received [13](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5271867350/jobs/9533345209#step:13:14)0023424 of 159490239 (81.5%), 117.1 MBs/sec
Received 134217728 of 246805727 (54.4%), 125.0 MBs/sec
Received 159490239 of 159490239 (100.0%), 108.0 MBs/sec
Cache Size: ~152 MB (159490239 B)
/usr/bin/tar -xf /home/runner/work/_temp/874235dc-a472-4345-829e-2a510842b93d/cache.tzst -P -C /home/runner/work/aurelia-slickgrid/aurelia-slickgrid --use-compress-program unzstd
Received 246805727 of 246805727 (100.0%), 134.4 MBs/sec
Cache Size: ~235 MB (246805727 B)
/usr/bin/tar -xf /home/runner/work/_temp/b48efa7a-0495-4e37-bb5d-816ab923e5ba/cache.tzst -P -C /home/runner/work/aurelia-slickgrid/aurelia-slickgrid --use-compress-program unzstd
Cache restored successfully
Cache restored successfully
/usr/local/bin/yarn --frozen-lockfile
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 2.46s.
/usr/local/bin/yarn cypress cache list
yarn run v1.22.19
$ cypress open cache list

DevTools listening on ws://127.0.0.1:46553/devtools/browser/202a1e77-8ae1-4d05-9cc2-0b7c8fbe73f4
[2259:06[14](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5271867350/jobs/9533345209#step:13:15)/[20](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5271867350/jobs/9533345209#step:13:21)38[22](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5271867350/jobs/9533345209#step:13:23).[28](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5271867350/jobs/9533345209#step:13:29)8207:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
Error: The operation was canceled.

I cancelled it because it never stops, just hangs there until I cancel it

For comparison again, here's a working execution with previous version

..........
/usr/bin/tar -xf /home/runner/work/_temp/65f5d920-0b22-4ef8-a116-4a087fa1da43/cache.tzst -P -C /home/runner/work/aurelia-slickgrid/aurelia-slickgrid --use-compress-program unzstd
Cache restored successfully
Cache restored successfully
/usr/local/bin/yarn --frozen-lockfile
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 3.22s.
/opt/hostedtoolcache/node/16.20.0/x64/bin/npx cypress cache list
┌─────────┬───────────────────┐
│ version │ last used         │
├─────────┼───────────────────┤
│ 12.14.0 │ a few seconds ago │
└─────────┴───────────────────┘
waiting on "http://localhost:9000" with timeout of 60 seconds

DevTools listening on ws://1[27](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5272142390/jobs/9534009453#step:13:28).0.0.1:35979/devtools/browser/93f0e017-0357-44ce-866e-df132e81c58f
[22[29](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5272142390/jobs/9534009453#step:13:30):0614/211[30](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5272142390/jobs/9534009453#step:13:31)8.0[38](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5272142390/jobs/9534009453#step:13:39)518:ERROR:gpu_memory_buffer_support_x11.cc([44](https://github.com/ghiscoding/aurelia-slickgrid/actions/runs/5272142390/jobs/9534009453#step:13:45))] dri3 extension not supported.
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.14.0                                                                        │
  │ Browser:        Chrome 113 (headless)                                                          │
  │ Node Version:   v16.16.0 (/home/runner/runners/2.304.0/externals/node16/bin/node)              │
....

@MikeMcC399
Copy link
Collaborator

@ssay-work

Our chrome browser tests started hanging on version 5.8.2 which was released on 6/13

Please give more details about your workflow. If it's a public workflow you can give a link. If it's private, then you could post the workflow together with a log of the workflow run.

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Jun 15, 2023

@ghiscoding

Looking at your logs I see that the workflow causing a problem is
https://github.com/ghiscoding/aurelia-slickgrid/blob/master/.github/workflows/main.yml

Could you please confirm that I am looking at the right workflow?

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Jun 15, 2023

@ssay-work / @ghiscoding

Thanks for both of you for your reports. I have submitted PR #942 to revert the change in 5.8.2 which caused problems for you.

@MikeMcC399
Copy link
Collaborator

@ghiscoding

The workflow
https://github.com/ghiscoding/aurelia-slickgrid/blob/master/.github/workflows/main.yml fails using
cypress-io/[email protected] trying to execute the command
/usr/local/bin/yarn cypress cache list

The reason this fails is because test/cypress/package.json in your repo defines a script cypress which overrides the command cypress:

"cypress": "cypress open"

so when github-action attempts to display the cypress cache content with

yarn cypress cache list

the command is executed instead as

yarn cypress open

So now the Cypress app (aka the launchpad) is opened and waits for user input, which never happens.

The example in the documentation on https://docs.cypress.io/guides/getting-started/opening-the-app#Adding-npm-Scripts suggests using a script name cypress:open for this purpose.

{
  "scripts": {
    "cypress:open": "cypress open"
  }
}

I suggest that you follow this example, as defining a script cypress with the same name as the npm module cypress causes ambiguity for Yarn and should be avoided.

Previously the cache was being displayed using npx cypress cache list which always used the cypress command, however this did not work correctly for all types of Yarn projects and this is the reason for the change in 5.8.2 which unfortunately caused your issue as a side-effect.

@nagash77
Copy link
Contributor

Hello, I just merged in @MikeMcC399 's PR and 5.8.3 just released. Please see if that fixes your problem.

@nagash77 nagash77 self-assigned this Jun 15, 2023
@MikeMcC399
Copy link
Collaborator

Thank you Ben @nagash77 for the quick response!

@ghiscoding

I forked your repo and confirmed

  1. Changing your script name from cypress to cypress:open allowed cypress-io/[email protected] to run successfully.
  2. Without the script name change and after the merge of PR revert: "fix: use yarn instead of npx with yarn.lock (#914)" #942 cypress-io/github-action@v5 picks up
    Download action repository 'cypress-io/github-action@v5' (SHA:d69252d52b9a31bad4f418f05ba2bc83687a02eb) aka v5.8.3 which also runs successfully.

@ssay-work

Your issue should also be resolved, since v5.8.3 is effectively the same as v5.8.1.
If you want to look at why v5.8.2 failed for you, you are welcome to post more information here.

@ghiscoding
Copy link

ghiscoding commented Jun 15, 2023

@ghiscoding

I forked your repo and confirmed

  1. Changing your script name from cypress to cypress:open allowed cypress-io/[email protected] to run successfully.
  2. Without the script name change and after the merge of PR revert: "fix: use yarn instead of npx with yarn.lock (#914)" #942 cypress-io/github-action@v5 picks upDownload action repository 'cypress-io/github-action@v5' (SHA:d69252d52b9a31bad4f418f05ba2bc83687a02eb) aka v5.8.3 which also runs successfully.

Thanks for all the troubleshooting, this is really helpful and I was quite surprise that the npm script name could affect this github action, I just started my day I'm in the process of updating everything with a PR running on my end. Also nice to see that my log was helpful in finding the issue I had :)

So I can confirm that v5.8.3 works for me. Thanks a lot for the quick response

@ssay-work
Copy link
Author

Thanks all, the reason 5.8.2 was failing for us is the exact same reason that @MikeMcC399 discovered for @ghiscoding .

I'll bring up the documentation to my devs, and we'll look at changing that script name from cypress to cypress:open.

Appreciate the quick turnaround on this!

@MikeMcC399
Copy link
Collaborator

@ghiscoding / @ssay-work

I'm happy to hear that you are back in business with your workflows! My apologies for breaking them temporarily. It was an aspect which I had not considered and it did not come up in testing.

It's also good to know that the failure reason was the same in both cases.

I added a note to the Discord server in the Best practices channel to alert other users about the pitfalls of redefining the name cypress in conjunction with Yarn usage.

@MikeMcC399
Copy link
Collaborator

There is now a caution published to the Cypress documentation

Getting Started > Opening the App > Adding npm Scripts

which explicitly advises against using cypress as the name of a script, due to its unwanted side-effects in a Yarn environment.

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

No branches or pull requests

4 participants