cypress: Cypress v3.3.0 hangs

Current behavior:

After upgrading to Cypress v3.3.0, I’m experiencing hanging tests, similar to the ones described in https://github.com/cypress-io/cypress/issues/1235 and https://github.com/cypress-io/cypress/issues/1333. The DEBUG=cypress:* logs continuously show the following logs once it hangs:

 cypress:server:timers child sending timer id 28 +6s
  cypress:server:timers child sending timer id 29 +277ms
  cypress:server:video capture stderr log { message: 'frame= 2793 fps= 27 q=13.0 size=    4608kB time=00:01:51.52 bitrate= 338.5kbits/s dup=2099 drop=0 speed=1.09x    ' } +552ms
  cypress:server:timers child sending timer id 30 +119ms
  cypress:server:timers child sending timer id 31 +298ms
  cypress:server:timers child sending timer id 32 +51ms
  cypress:server:video capture stderr log { message: 'frame= 2805 fps= 27 q=12.0 size=    4608kB time=00:01:52.00 bitrate= 337.0kbits/s dup=2103 drop=0 speed=1.09x    ' } +498ms
  cypress:server:video capture stderr log { message: 'frame= 2819 fps= 27 q=13.0 size=    4608kB time=00:01:52.56 bitrate= 335.4kbits/s dup=2108 drop=0 speed=1.09x    ' } +551ms
  cypress:server:timers child sending timer id 33 +1s
  cypress:server:timers child sending timer id 34 +86ms
  cypress:server:video capture stderr log { message: 'frame= 2833 fps= 27 q=12.0 size=    4608kB time=00:01:53.12 bitrate= 333.7kbits/s dup=2118 drop=0 speed=1.09x    ' } +593ms
  cypress:server:video capture stderr log { message: 'frame= 2846 fps= 27 q=12.0 size=    4864kB time=00:01:53.64 bitrate= 350.6kbits/s dup=2122 drop=0 speed=1.09x    ' } +510ms

Desired behavior:

Tests shouldn’t hang and all tests should pass. Desired behavior is restored when I revert to Cypress v3.2.0

Steps to reproduce: (app code and test code)

Unfortunately I don’t have a chance right now to try and set up a reproducible example. However, v3.3.0 consistently hangs, and v3.2.0 consistently passes.

Versions

Cypress: 3.3.0 Browser: Electron 61

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 10
  • Comments: 21 (7 by maintainers)

Most upvoted comments

My tests are also hanging in CI, but I’m not using video or iframes.

The original issue of seeing this warning in the console has been fixed since Cypress 3.5.0 when we updated Electron as part of https://github.com/cypress-io/cypress/pull/4720

Error while parsing the 'allow' attribute: 'accelerometer;', 'autoplay;', 'encrypted-media;', 'gyroscope;', 'picture-in-picture' are invalid feature names.

Closing as resolved.

@jennifer-shehane What additional information would be helpful here? We have the same issue when running on Linux (Ubuntu) containers but the same code works fine on Mac. We are running tests on Chrome and have this issue with Cypress: 3.2.0

Same problem. Failed at Electron 61 but work well with Chrome. I don’t have either video embedded or iframes. After trying these steps, it’s now working for me.

  1. Delete folder Cypress in C:\Users\***\AppData\Roaming. Where *** is your username.
  2. Delete node_modules
  3. Run yarn

Hello everyone. I’ve been seeing this issue for a while now (originally reported it in Aug '18 https://github.com/cypress-io/cypress/issues/2377) and haven’t been lucky to figure it out. Though yesterday I found out that when video encoding seems to hang it’s in fact due to browser not being killed properly.

Just after test finishes I see following in debug:

cypress:server:run attempting to close the browser
cypress:server:browsers killing browser  

followed by request to tracking scripts that are fired on “unload” event from JS.

And what I’ve noticed is, that when the request is fired (browser is not killed fast enough?) in video it looks like that:

  • the list of test steps disappears from the window
  • last page that test visited starts to load indefinitely resulting in never ending encoding of video (Ctrl+C and/or pipeline timeout kills it)

When the request isn’t fired (and only then) I receive cypress:server:browsers browser process killed in the debug log.

Edit:

I’ve just figured out a PoC to behaviour I’ve described, which is also consistent with problem I have on my page:

index.html:

<html>
<head>
    <script>
        window.onbeforeunload = function (e) {
            e = e || window.event;
            
            if (e) {
                e.returnValue = 'Sure?';
            }
            
            return 'Sure?';
        };
    </script>
</head>
<body>
<div id="test">test</div>
</body>
</html>

test.js

describe('poc', function () {
    it('should hang | @olxpl @olxua @olxkz @olxbg @olxpt', function() {
        cy.visit('/index.html');
        cy.get('#test').should('exist');
    });

});

Can’t believe I didn’t notice that earlier but we do, in fact, have a prompt before closing the window on last page the test is visiting.

Here’s a video https://www.youtube.com/watch?v=2GjGaJI93Ow that’s being recorded.

@jennifer-shehane please have a look

My case has been the opposite - Chrome will sometimes hang whereas Electron never seems to. I’ve had this happen on 3.1.0, 3.2.0 and 3.3.1.

I don’t have a reproducible example I can share at the moment other than my DEBUG logs, which I would rather share privately. @jennifer-shehane if you think those could help let me know and please advise how I could share them.

Same here. If I run it locally the iframe that displays the UI in the middle is completely frozen. The log is like this

  cypress:server:events got request for event: get:project:status, { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests' } +10s
  cypress:server:project get project status for undefined /Users/ran/src/confluence-frontend/next/packages/integration-tests +10s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.9121330451835215, data: { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests', state: 'VALID' } } } +1ms
  cypress:server:timers child sending timer id 35 +19s
  cypress:server:timers child sending timer id 37 +774ms
  cypress:server:events got request for event: get:project:status, { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests' } +10s
  cypress:server:project get project status for undefined /Users/ran/src/confluence-frontend/next/packages/integration-tests +10s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.27802936598884, data: { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests', state: 'VALID' } } } +1ms
  cypress:server:timers child sending timer id 51 +5s
  cypress:server:timers child sending timer id 53 +384ms
  cypress:server:events got request for event: get:project:status, { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests' } +10s
  cypress:server:project get project status for undefined /Users/ran/src/confluence-frontend/next/packages/integration-tests +10s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.2397979064758744, data: { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests', state: 'VALID' } } } +0ms
  cypress:server:events got request for event: get:project:status, { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests' } +10s
  cypress:server:project get project status for undefined /Users/ran/src/confluence-frontend/next/packages/integration-tests +10s
  cypress:server:project no project id +1ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.23825683881274062, data: { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests', state: 'VALID' } } } +1ms
  cypress:server:events got request for event: get:project:status, { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests' } +10s
  cypress:server:project get project status for undefined /Users/ran/src/confluence-frontend/next/packages/integration-tests +10s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.49079102256314777, data: { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests', state: 'VALID' } } } +0ms
  cypress:server:events got request for event: get:project:status, { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests' } +10s
  cypress:server:project get project status for undefined /Users/ran/src/confluence-frontend/next/packages/integration-tests +10s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.7071413449160777, data: { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests', state: 'VALID' } } } +1ms

The UI won’t stuck if I ran the test in Chrome. Here is the log:

  cypress:server:events got request for event: get:project:status, { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests' } +10s
  cypress:server:project get project status for undefined /Users/ran/src/confluence-frontend/next/packages/integration-tests +10s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.6056192172812374, data: { path: '/Users/ran/src/confluence-frontend/next/packages/integration-tests', state: 'VALID' } } } +1ms
  cypress:server:server Getting remote state: { auth: null, props: { port: '443', tld: 'net', domain: 'atlassian' }, origin: 'https://confluence-frontend-fabric-sev1-tests.atlassian.net', strategy: 'http', visiting: false, domainName: 'atlassian.net', fileServer: null } +3s