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

Test hangs on Jenkins CI/ locally #2482

Closed
shinobi64 opened this issue Sep 17, 2018 · 7 comments
Closed

Test hangs on Jenkins CI/ locally #2482

shinobi64 opened this issue Sep 17, 2018 · 7 comments

Comments

@shinobi64
Copy link

shinobi64 commented Sep 17, 2018

Current behavior:

Test run stucks on Jenkins CI (using Electron)/ locally (using electron). Using chrome as browser option the test finishes as expected:

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    3.1.0                                                                              │
  │ Browser:    Chrome 69                                                                          │
  │ Specs:      1 found (test_spec.js)                                                             │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running: test_spec.js...                                                                 (1 of 1) 

Warning: Cypress can only record videos when using the built in 'electron' browser.

You have set the browser to: 'chrome'

A video will not be recorded when using this browser.

  (Results)

  ┌────────────────────────────┐
  │ Tests:        1            │
  │ Passing:      1            │
  │ Failing:      0            │
  │ Pending:      0            │
  │ Skipped:      0            │
  │ Screenshots:  0            │
  │ Video:        false        │
  │ Duration:     9 seconds    │
  │ Spec Ran:     test_spec.js │
  └────────────────────────────┘


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

  (Run Finished)


      Spec                                                Tests  Passing  Failing  Pending  Skipped 
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔ test_spec.js                              00:09        1        1        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    All specs passed!                           00:09        1        1        -        -        -  

Using Electron it hangs:

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    3.1.0                                                                              │
  │ Browser:    Electron 59 (headless)                                                             │
  │ Specs:      1 found (test_spec.js)                                                             │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running: test_spec.js...                                                                 (1 of 1) 

  (Results)

  ┌────────────────────────────┐
  │ Tests:        1            │
  │ Passing:      1            │
  │ Failing:      0            │
  │ Pending:      0            │
  │ Skipped:      0            │
  │ Screenshots:  0            │
  │ Video:        true         │
  │ Duration:     13 seconds   │
  │ Spec Ran:     test_spec.js │
  └────────────────────────────┘

cypress:server:run attempting to close the browser +8ms
  cypress:server:browsers killing browser process +0ms
  cypress:server:server Getting remote state: { auth: null, props: { port: '4444', tld: 'localhost', domain: '' }, origin: 'http://localhost:4444', strategy: 'http', visiting: false, domainName: 'localhost', fileServer: null } +49ms
  cypress:server:proxy handling proxied request { url: 'someUrl', proxiedUrl: 'someProxyUrl', headers: { host: 'localhost:4444', 'proxy-connection': 'keep-alive', accept: 'text/plain, */*; q=0.01', 'x-requested-with': 'XMLHttpRequest', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/3.1.0 Chrome/59.0.3071.115 Electron/1.8.2 Safari/537.36', referer: 'someReferer', 'accept-encoding': 'gzip, deflate', 'accept-language': 'en-US', cookie: ' __cypress.unload=true' }, remoteState: { auth: null, props: { port: '4444', tld: 'localhost', domain: '' }, origin: 'http://localhost:4444', strategy: 'http', visiting: false, domainName: 'localhost', fileServer: null } } +0ms
  cypress:server:routes Serving Cypress front-end by requested URL: /__/ +10ms
  cypress:server:server Getting remote state: { auth: null, props: { port: '4444', tld: 'localhost', domain: '' }, origin: 'http://localhost:4444', strategy: 'http', visiting: false, domainName: 'localhost', fileServer: null } +0ms
  cypress:server:runner serving runner index.html with config { version: '3.1.0', platform: 'darwin', arch: 'x64', projectName: 'test' } +0ms
  cypress:server:video capture stderr log { message: 'Past duration 0.999992 too large' } +142ms
  cypress:server:video capture stderr log { message: '    Last message repeated 1 times' } +109ms
  cypress:server:video capture stderr log { message: 'frame=  353 fps= 35 q=17.0 size=    1280kB time=00:00:13.56 bitrate= 773.3kbits/s dup=122 drop=0 speed=1.36x    ' } +0ms
  cypress:server:video capture stderr log { message: 'frame=  365 fps= 35 q=12.0 size=    1536kB time=00:00:14.04 bitrate= 896.2kbits/s dup=129 drop=0 speed=1.34x    ' } +555ms
  cypress:server:video capture stderr log { message: 'frame=  380 fps= 34 q=12.0 size=    1536kB time=00:00:14.64 bitrate= 859.5kbits/s dup=139 drop=0 speed=1.32x    ' } +650ms
  cypress:server:video capture stderr log { message: 'frame=  393 fps= 34 q=12.0 size=    1536kB time=00:00:15.16 bitrate= 830.0kbits/s dup=148 drop=0 speed=1.31x    ' } +505ms
  cypress:server:video capture stderr log { message: 'frame=  409 fps= 33 q=12.0 size=    1536kB time=00:00:15.80 bitrate= 796.4kbits/s dup=159 drop=0 speed=1.29x    ' } +595ms
  cypress:server:video capture stderr log { message: 'frame=  422 fps= 33 q=12.0 size=    1536kB time=00:00:16.32 bitrate= 771.0kbits/s dup=168 drop=0 speed=1.28x    ' } +499ms
  cypress:server:video capture stderr log { message: 'frame=  436 fps= 33 q=12.0 size=    1536kB time=00:00:16.88 bitrate= 745.5kbits/s dup=177 drop=0 speed=1.26x    ' } +649ms
  cypress:server:video capture stderr log { message: 'frame=  449 fps= 32 q=12.0 size=    1536kB time=00:00:17.40 bitrate= 723.2kbits/s dup=186 drop=0 speed=1.26x    ' } +506ms
  cypress:server:video capture stderr log { message: 'frame=  465 fps= 32 q=12.0 size=    1792kB time=00:00:18.04 bitrate= 813.8kbits/s dup=197 drop=0 speed=1.24x    ' } +595ms
  cypress:server:video capture stderr log { message: 'frame=  480 fps= 32 q=12.0 size=    1792kB time=00:00:18.64 bitrate= 787.6kbits/s dup=207 drop=0 speed=1.23x    ' } +648ms
  cypress:server:video capture stderr log { message: 'frame=  497 fps= 32 q=12.0 size=    1792kB time=00:00:19.32 bitrate= 759.9kbits/s dup=219 drop=0 speed=1.23x    ' } +603ms
  cypress:server:video capture stderr log { message: 'frame=  509 fps= 31 q=13.0 size=    1792kB time=00:00:19.80 bitrate= 741.4kbits/s dup=227 drop=0 speed=1.22x    ' } +499ms
  cypress:server:video capture stderr log { message: 'frame=  524 fps= 31 q=12.0 size=    1792kB time=00:00:20.40 bitrate= 719.6kbits/s dup=237 drop=0 speed=1.21x    ' } +650ms
  cypress:server:video capture stderr log { message: 'frame=  537 fps= 31 q=12.0 size=    1792kB time=00:00:20.92 bitrate= 701.7kbits/s dup=246 drop=0 speed=1.21x    ' } +500ms
  cypress:server:video capture stderr log { message: 'frame=  553 fps= 31 q=12.0 size=    1792kB time=00:00:21.56 bitrate= 680.9kbits/s dup=257 drop=0 speed= 1.2x    ' } +601ms
  cypress:server:video capture stderr log { message: 'frame=  565 fps= 31 q=12.0 size=    1792kB time=00:00:22.04 bitrate= 666.1kbits/s dup=265 drop=0 speed=1.19x    ' } +500ms
  cypress:server:video capture stderr log { message: 'frame=  580 fps= 30 q=12.0 size=    1792kB time=00:00:22.64 bitrate= 648.4kbits/s dup=275 drop=0 speed=1.19x    ' } +648ms
  cypress:server:video capture stderr log { message: 'frame=  593 fps= 30 q=12.0 size=    1792kB time=00:00:23.16 bitrate= 633.9kbits/s dup=284 drop=0 speed=1.18x    ' } +500ms
  cypress:server:video capture stderr log { message: 'frame=  605 fps= 30 q=12.0 size=    1792kB time=00:00:23.64 bitrate= 621.0kbits/s dup=292 drop=0 speed=1.18x    ' } +500ms
  cypress:server:video capture stderr log { message: 'frame=  618 fps= 30 q=12.0 size=    1792kB time=00:00:24.16 bitrate= 607.6kbits/s dup=301 drop=0 speed=1.17x    ' } +505ms
  cypress:server:video capture stderr log { message: 'frame=  634 fps= 30 q=12.0 size=    1792kB time=00:00:24.80 bitrate= 592.0kbits/s dup=312 drop=0 speed=1.17x    ' } +597ms
  cypress:server:timers clearing timer id 194 from queue { '194': { args: [], ms: 85000, cb: [Function] } } +160ms
  cypress:server:timers queuing timer id 195 after 85000 ms +0ms
  cypress:server:timers child received timer id 195 +12s
  cypress:server:video capture stderr log { message: 'frame=  649 fps= 30 q=12.0 size=    1792kB time=00:00:25.40 bitrate= 578.0kbits/s dup=322 drop=0 speed=1.16x    ' } +488ms
  cypress:server:video capture stderr log { message: 'frame=  662 fps= 30 q=12.0 size=    1792kB time=00:00:25.92 bitrate= 566.4kbits/s dup=331 drop=0 speed=1.16x    ' } +500ms
  cypress:server:video capture stderr log { message: 'frame=  674 fps= 29 q=12.0 size=    1792kB time=00:00:26.40 bitrate= 556.1kbits/s dup=339 drop=0 speed=1.16x    ' } +500ms
  cypress:server:video capture stderr log { message: 'frame=  690 fps= 29 q=12.0 size=    1792kB time=00:00:27.04 bitrate= 542.9kbits/s dup=350 drop=0 speed=1.15x    ' } +605ms
  cypress:server:timers child sending timer id 4 +4s
  cypress:server:video capture stderr log { message: 'frame=  747 fps= 29 q=12.0 size=    1792kB time=00:00:29.32 bitrate= 500.7kbits/s dup=403 drop=0 speed=1.14x    ' } +2s
  cypress:server:timers child sending timer id 24 +2s
  cypress:server:video capture stderr log { message: 'frame=  809 fps= 29 q=12.0 size=    2048kB time=00:00:31.80 bitrate= 527.6kbits/s dup=462 drop=0 speed=1.12x    ' } +3s
  cypress:server:timers child sending timer id 26 +284ms
  cypress:server:timers child sending timer id 27 +24ms
  cypress:server:timers child sending timer id 28 +0ms
  cypress:server:timers child sending timer id 29 +183ms
  cypress:server:timers child sending timer id 30 +11ms
  cypress:server:timers child sending timer id 31 +10ms
  cypress:server:timers child sending timer id 32 +10ms
  cypress:server:timers child sending timer id 33 +10ms
  cypress:server:timers child sending timer id 34 +16ms
  cypress:server:timers child sending timer id 35 +10ms

This is only happening with this specific test case. Inside we're using a generation of a blob object to simulate a file upload process - not sure if electron has an issue with this.

Desired behavior:

Run on electron should finish - same as with chrome.

Steps to reproduce:

Versions

Cypress: 3.1.0
Mac OS X: 10.13.6

@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Sep 17, 2018
@jennifer-shehane
Copy link
Member

Error likely causing issues is:

cypress:server:video capture stderr log { message: 'Past duration 0.999992 too large' } +142ms

Duplicate of #2377

@shinobi64
Copy link
Author

@jennifer-shehane I don't think that it is originally related to the video output. I re-ran it with video:false configuration setting and again it got hung up (there is only one spec file existing)

(Results)

  ┌────────────────────────────┐
  │ Tests:        1            │
  │ Passing:      1            │
  │ Failing:      0            │
  │ Pending:      0            │
  │ Skipped:      0            │
  │ Screenshots:  0            │
  │ Video:        false        │
  │ Duration:     13 seconds   │
  │ Spec Ran:     test_spec.js │
  └────────────────────────────┘

  cypress:server:run attempting to close the browser +11ms
  cypress:server:browsers killing browser process +0ms
  cypress:server:server Getting remote state: { auth: null, props: { port: '4444', tld: 'localhost', domain: '' }, origin: 'http://localhost:4444', strategy: 'http', visiting: false, domainName: 'localhost', fileServer: null } +53ms
  cypress:server:proxy handling proxied request { url: 'someUrl', proxiedUrl: 'someOriginURL', headers: { host: 'localhost:4444', 'proxy-connection': 'keep-alive', accept: 'text/plain, */*; q=0.01', 'x-requested-with': 'XMLHttpRequest', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/3.1.0 Chrome/59.0.3071.115 Electron/1.8.2 Safari/537.36', referer: 'someReferer', 'accept-encoding': 'gzip, deflate', 'accept-language': 'en-US', cookie: ' __cypress.unload=true' }, remoteState: { auth: null, props: { port: '4444', tld: 'localhost', domain: '' }, origin: 'http://localhost:4444', strategy: 'http', visiting: false, domainName: 'localhost', fileServer: null } } +1ms
  cypress:server:routes Serving Cypress front-end by requested URL: /__/ +6ms
  cypress:server:server Getting remote state: { auth: null, props: { port: '4444', tld: 'localhost', domain: '' }, origin: 'http://localhost:4444', strategy: 'http', visiting: false, domainName: 'localhost', fileServer: null } +0ms
  cypress:server:runner serving runner index.html with config { version: '3.1.0', platform: 'darwin', arch: 'x64', projectName: 'test' } +0ms
  cypress:server:timers clearing timer id 194 from queue { '194': { args: [], ms: 85000, cb: [Function] } } +10s
  cypress:server:timers queuing timer id 195 after 85000 ms +0ms
  cypress:server:timers child received timer id 195 +10s
  cypress:server:timers child sending timer id 4 +4s
  cypress:server:timers child sending timer id 24 +3s
  cypress:server:timers child sending timer id 26 +263ms
  cypress:server:timers child sending timer id 27 +44ms
  cypress:server:timers child sending timer id 28 +10ms
  cypress:server:timers child sending timer id 29 +247ms
  cypress:server:timers child sending timer id 30 +19ms
  cypress:server:timers child sending timer id 31 +25ms
  cypress:server:timers child sending timer id 32 +29ms
  cypress:server:timers child sending timer id 33 +21ms
  cypress:server:timers child sending timer id 34 +27ms
  cypress:server:timers child sending timer id 35 +11ms
  cypress:server:timers child sending timer id 36 +10ms
  cypress:server:timers child sending timer id 37 +10ms
  cypress:server:timers child sending timer id 38 +9ms
  cypress:server:timers child sending timer id 39 +12ms
  cypress:server:timers child sending timer id 40 +16ms
  cypress:server:timers child sending timer id 41 +8ms
  cypress:server:timers child sending timer id 42 +10ms
  cypress:server:timers child sending timer id 43 +11ms
  cypress:server:timers child sending timer id 44 +8ms
  cypress:server:timers child sending timer id 45 +13ms
  cypress:server:timers child sending timer id 46 +13ms
  cypress:server:timers child sending timer id 47 +9ms
  cypress:server:timers child sending timer id 48 +30ms
  cypress:server:timers child sending timer id 49 +30ms
  cypress:server:timers child sending timer id 50 +12ms
  cypress:server:timers child sending timer id 51 +28ms
  cypress:server:timers child sending timer id 52 +22ms
  cypress:server:timers child sending timer id 53 +254ms
  cypress:server:timers child sending timer id 54 +240ms

@neg0
Copy link

neg0 commented Sep 23, 2018

@jennifer-shehane I believe this should be the Highest Priority to be fixed as a Hotfix as soon as possible really. I recently convinced my team and department to use Cypress for all our e2e testings and all our Jenkin builds started to crash when we added cypress execution to our Jenkin build process. This is almost embarrassing for a framework that is built for ensuring better build!

@shinobi64
Copy link
Author

shinobi64 commented Oct 26, 2018

@jennifer-shehane we solved this now with a global overwrite of the window.onbeforeunload function at the end of all runs - in file cypress/support/index.js

after(function() {
    cy.window().then(win => win.onbeforeunload = undefined );
});

It seems to be the case that cypress is not able to properly close the electron browser session if the window.onbeforeunload script returns something which would trigger a (non HTML) dialog to the user.

@jennifer-shehane
Copy link
Member

@shinobi64 Thank you for detailing a workaround. We will have to look into the case of window.onbeforeunload triggering dialogs being an issue here.

@neg0 We're unable to prioritize issues without reproducible examples or some lead on where the problem originates. Can you confirm the workaround fixes your issue?

@jennifer-shehane jennifer-shehane added stage: ready for work The issue is reproducible and in scope type: bug and removed type: duplicate This issue or pull request already exists labels Oct 26, 2018
@rbokel
Copy link

rbokel commented Oct 31, 2018

Had the same issue and the work-around fixed it for me.
It would be good to get a error message at least.
Currently tests just hang

@jennifer-shehane
Copy link
Member

duplicate of #2118

@jennifer-shehane jennifer-shehane removed stage: ready for work The issue is reproducible and in scope labels Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants