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

CLI does not detect killed Electron process with SIGKILL, SIGBUS etc #5808

Closed
bahmutov opened this issue Nov 27, 2019 · 2 comments · Fixed by #5810

Comments

@bahmutov
Copy link
Collaborator

@bahmutov bahmutov commented Nov 27, 2019

Cypress v3.6

  • start Cypress CLI
npx cypress open
const child = cp.spawn(executable, electronArgs, stdioOptions)

function resolveOn (event) {
  return function (code, signal) {
    debug('child event fired %o', { event, code, signal })
    resolve(code)
  }
}

child.on('close', resolveOn('close'))
child.on('exit', resolveOn('exit'))
child.on('error', reject)
  • if the child process is killed for some reason, for example with
$ ps
66579 ttys005    0:00.47 node /Users/gleb/.nvm/versions/node/v12.13.0/bin/npx cypress open
66580 ttys005    0:02.83 /Users/gleb/Library/Caches/Cypress/3.6.1/Cypress.app/Contents/MacOS/Cypress 
$ kill -9 66580

then our CLI receives code: null and thinks everything is peachy

DEBUG=cypress:cli npx cypress open
  cypress:cli child event fired { event: 'exit', code: null, signal: 'SIGKILL' } +14s
  cypress:cli child event fired { event: 'close', code: null, signal: 'SIGKILL' } +1ms
$ echo $?
0

Seems SIGBUS is sent to the child process when it runs out of shared memory space for example https://stackoverflow.com/questions/53902507/unknown-error-session-deleted-because-of-page-crash-from-unknown-error-cannot/53970825#53970825

Proposal

Only exit with code 0 when the child process successfully finishes with code: 0, signal: null

@cypress-bot

This comment has been minimized.

Copy link

@cypress-bot cypress-bot bot commented Nov 27, 2019

The code for this is done in cypress-io/cypress#5810, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot

This comment has been minimized.

Copy link

@cypress-bot cypress-bot bot commented Nov 27, 2019

Released in 3.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.