Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cypress verification timed out after 30000 milliseconds

I am using cypress 5.0 in JS project. When I try to run npx cypress open keep getting error verification timed out after 30000 milliseconds.

Node version: v12.18.2 OS: Windows 7 Cypress : 5.0.0

I have downgraded to Cypress 4.0.0 and downgraded my node too. But keep getting the error. Please find the screenshot below. 2

enter image description here

like image 364
Ragavan Rajan Avatar asked Aug 31 '20 09:08

Ragavan Rajan


People also ask

How do I fix timeout error in Cypress?

Developers may opt to manually address flaky tests caused by timeout errors by pursuing one or a combination of the following: Use the Cypress intercept and aliasing commands to require Cypress to wait on your asynchronous operations to complete before running the next command or assertion.

What does Cypress verify do?

cypress verify Verify that Cypress is installed correctly and is executable. Note that the cypress verify command is executed as part of the cypress open and cypress run commands.


4 Answers

I had a similar issue and I used the npx cypress verify to carry out the verification

like image 126
Ukpai Chukwuemeka Avatar answered Sep 21 '22 05:09

Ukpai Chukwuemeka


This issue is not related to Cypress version. To resolve it, you need to increase the default timeout.

Open node_modules\cypress\lib\tasks\verify.js, search for VERIFY_TEST_RUNNER_TIMEOUT_MS and change it from 30000 (default) to 100000.

Save the file, then try to open the runner.

like image 23
Kumar Gaurav Avatar answered Sep 19 '22 05:09

Kumar Gaurav


Retrying launching Cypress one more time worked out with the error being gone, hmm...

like image 44
Daniel Danielecki Avatar answered Sep 23 '22 05:09

Daniel Danielecki


From Cypress version 9.2.0, you no longer have to change the timeout value in node_modules\cypress\lib\tasks\verify.js file manually.

Instead, you can utilize an environment variable called CYPRESS_VERIFY_TIMEOUT "to override the timeout duration of the verify command". Here is the link to the documentation about cypress verify command that mentions it.

Even better, starting from version 9.3.0, we can set the environment variable in a project's package.json or .npmrc (or .yarnrc) file.

Using this environment variable to increase the timeout (3 minutes for us) was necessary for us to ensure stability in our CI testing pipeline.

like image 32
flying_duck Avatar answered Sep 21 '22 05:09

flying_duck