简体   繁体   中英

Cypress UI tests throwing time out for waiting for browser

I am running Cypress UI tests in AzureDevOps CI/CD and some how most of the UI test are getting failed. All of the tests were running fine few days back. It is throwing a Timed out waiting for the browser to connect. Retrying. Timed out waiting for the browser to connect. Retrying. error: Any advise on how to resolve the issue.

Environment Details: Cypress version: 3.4.1, Node: 10.x, Azure DevOps CI/CD

Running: report/send-report.spec.js...                         (12 of 14) 
2019-10-10T00:47:31.0294852Z 
2019-10-10T00:47:31.0295427Z Warning: Cypress can only record videos when using the built in 'electron' browser.
2019-10-10T00:47:31.0295707Z 
2019-10-10T00:47:31.0296579Z You have set the browser to: 'chrome'
2019-10-10T00:47:31.0296837Z 
2019-10-10T00:47:31.0297613Z A video will not be recorded when using this browser.
2019-10-10T00:47:31.0313740Z (node:4030) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit
2019-10-10T00:48:01.0316223Z 
2019-10-10T00:48:01.0592004Z Timed out waiting for the browser to connect. Retrying...
2019-10-10T00:48:31.0587550Z 
2019-10-10T00:48:31.0839142Z Timed out waiting for the browser to connect. Retrying again...
2019-10-10T00:49:01.0877330Z 
2019-10-10T00:49:01.1241198Z The browser never connected. Something is wrong. The tests cannot run. Aborting...

I have noticed that you have set retries value as 2 to enable immediately retry on failure instead of moving on to the next test. So I recommend you to change the value and check if the error still occur.

And you can try another workaround, to change numTestsKeptInMemory down from 50 to something sane like 1 or 0 . Here is the offical documentation. https://docs.cypress.io/guides/references/configuration.html#Global

In addition, it seems like an occasional error. Because some users failed on the first pipeline, but succeed on the second pipeline. And this should be a problem with cypress itself or your system's memory, you can report this problem to cypress directly.

Here is the link about cypress-io/cypress. https://github.com/cypress-io/cypress/issues/

And here is the link about the same error message. https://github.com/cypress-io/cypress/issues/1305

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM