Closed AndrewLeedham closed 1 year ago
Doing some further digging, it seems like the last test is not able to load a local mp4 video. But it some times does and passes 😕 https://user-images.githubusercontent.com/5557458/133644099-b73a3b93-c7fa-41ea-b736-b6af35f9b72e.mp4
So removing the tests with videos stops the error occurring. It seems to fail before it completes any of the video tests and when the it randomly passes it outputs the following:
| ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
| ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
| ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
| ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
| ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
| ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
| ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
| ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
| ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
| ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
| ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
| ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
| ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
| ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
| ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
| ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
So I am wondering if the random failure is to do with it looking for a graphics card, and that process is hanging for whatever reason.
Edit:
Nope that's not it. I used echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc
from https://github.com/cypress-io/cypress/issues/4351#issuecomment-559489091 which suppressed the ALSA error, but the random IPC error still occurs.
More error info from a failing run:
cypress:server:reporter got mocha event 'test:after:run' with args: [ { id: 'r2', order: 1, title: 'switches the video on different viewports', hookName: 'after each', err: { message: "Cannot destructure property 'data' of 'undefined' as it is undefined.\n" + '\n' + 'Because this error occurred during a `after each` hook we are skipping all of the remaining tests.', name: 'TypeError', stack: "TypeError: Cannot destructure property 'data' of 'undefined' as it is undefined.\n" + '\n' + 'Because this error occurred during a `after each` hook we are skipping all of the remaining tests.\n' + ' at /root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/lib/browsers/cdp_automation.js:253:34\n' + ' at tryCatcher (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)\n' + ' at Promise._settlePromiseFromHandler (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)\n' + ' at Promise._settlePromise (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)\n' + ' at Promise._settlePromise0 (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)\n' + ' at Promise._settlePromises (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:729:18)\n' + ' at _drainQueueStep (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)\n' + ' at _drainQueue (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)\n' + ' at Async._drainQueues (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)\n' + ' at Immediate.Async.drainQueues [as _onImmediate] (/root/.cache/.yarn/.cypress/8.4.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)\n' + ' at processImmediate (internal/timers.js:461:21)\n' }, state: 'failed', failedFromHookId: 'h6', body: 'function () {\n' + ' cy.mobile();\n' + ' cy.mount( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shared_XDSInternalWrapper__WEBPACK_IMPORTED_MODULE_0__["default"], {\n' + ' children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Video_Video__WEBPACK_IMPORTED_MODULE_1__.Video, {\n' + ' src: {\n' + " mobile: '/__cypress/src/videos/600x600.mp4',\n" + " tablet: '/__cypress/src/videos/1200x450.mp4'\n" + ' },\n' + ' ratio: {\n' + ' mobile: [1, 1],\n' + ' tablet: [1200, 450]\n' + ' }\n' + ' })\n' + ' }));\n' + " cy.get('video > source').should('have.attr', 'src', '/__cypress/src/videos/600x600.mp4');\n" + " cy.get('video').should('have.length', 1);\n" + ' cy.desktop();\n' + " cy.get('video').should('have.length', 1);\n" + " cy.get('video > source').should('have.attr', 'src', '/__cypress/src/videos/1200x450.mp4');\n" + '}', type: 'test', duration: 60163, wallClockStartedAt: '2021-09-17T23:02:30.492Z', wallClockDuration: 60329, timings: { lifecycle: 12, 'before all': [Array], 'before each': [Array], test: [Object], 'after each': [Array] }, file: null, invocationDetails: { function: 'Object.getInvocationDetails', fileUrl: 'http://localhost:56535/__cypress/runner/cypress_runner.js', originalFile: 'http://localhost:56535/__cypress/runner/cypress_runner.js', line: 195314, column: 18, whitespace: ' ' }, final: true, currentRetry: 0, retries: 0 } ] +0ms
Which seems to be complaining about this line: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/browsers/cdp_automation.ts#L320
Full test log: https://gist.github.com/AndrewLeedham/aa76487dd25e5195522cb90ac9a6761b
Interestingly disabling the screenshots with "screenshotOnRunFailure": false
made code-coverage timeout. So I disabled code-coverage and that gave me a more typical timeout error:
Any ideas why code-coverage would/could hide actual errors?
Edit:
It would seem that removing the failing test does not fix the IPC issue. So I believe this error is being caused by the @cypress/code-coverage/task
plugin!
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
This issue has been closed due to inactivity.
Current behavior
The last test in my cypress suite randomly fails in CI. It seems to be un-related to the test itself, but some cleanup failing.
Error logs
plugins/index.js
wepback.config.js
Desired behavior
Consistent test runs in CI. Or better error messages if this issue is something wrong with how I have things set up.
Test code to reproduce
I will try and create a repro when I get time.
Cypress Version
8.4.0
Other
CI errors are happening in GitHub actions, using the
cypress run-ct
command.cypress version
output: