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.
Run on electron should finish - same as with chrome.
Cypress: 3.1.0
Mac OS X: 10.13.6
Error likely causing issues is:
cypress:server:video capture stderr log { message: 'Past duration 0.999992 too large' } +142ms
Duplicate of https://github.com/cypress-io/cypress/issues/2377
@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
@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!
@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.
@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?
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
duplicate of https://github.com/cypress-io/cypress/issues/2118
Most helpful comment
@jennifer-shehane we solved this now with a global overwrite of the
window.onbeforeunloadfunction at the end of all runs - in filecypress/support/index.jsIt seems to be the case that cypress is not able to properly close the electron browser session if the
window.onbeforeunloadscript returns something which would trigger a (non HTML) dialog to the user.