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

No longer working on Node.js 0.10 #154

Closed
sindresorhus opened this issue Nov 7, 2015 · 4 comments
Closed

No longer working on Node.js 0.10 #154

sindresorhus opened this issue Nov 7, 2015 · 4 comments
Labels
bug current functionality does not work as desired priority

Comments

@sindresorhus
Copy link
Member

Not sure why the tests didn't catch this.

// test.js
import test from 'ava';

test(t => {
    t.pass();
    t.end();
});
❯ node -v
v0.10.40

❯ ava test.js

TypeError: Cannot read property 'stack' of undefined
    at error (/usr/local/lib/node_modules/ava/cli.js:51:19)
From previous event:
    at Object.<anonymous> (/usr/local/lib/node_modules/ava/cli.js:218:34)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:935:3

// @floatdrop

@sindresorhus sindresorhus added bug current functionality does not work as desired priority labels Nov 7, 2015
@floatdrop
Copy link
Contributor

@sindresorhus most likely, because this line rejects to undefined and cli trys to get stack from undefined.

@sindresorhus
Copy link
Member Author

Yup, but I'm unsure why. That test should pass, but it's rejecting somehow.

@floatdrop
Copy link
Contributor

@sindresorhus probably because we kill process after all tests are done - and sometimes Node.js 0.10 will return SIGTERM exit code (143) which is trigger error handler.

@jamestalmage
Copy link
Contributor

Should we be sending a different kill signal?

https://nodejs.org/api/process.html#process_signal_events

  • SIGTERM and SIGINT have default handlers on non-Windows platforms that resets the terminal mode before exiting with code 128 + signal number. If one of these signals has a listener installed, its default behaviour will be removed (node will no longer exit).
  • SIGPIPE is ignored by default, it can have a listener installed.
  • SIGHUP is generated on Windows when the console window is closed, and on other platforms under various similar conditions, see signal(7). It can have a listener installed, however node will be unconditionally terminated by Windows about 10 seconds later. On non-Windows platforms, the default behaviour of SIGHUP is to terminate node, but once a listener has been installed its default behaviour will be removed.
  • SIGTERM is not supported on Windows, it can be listened on.
  • SIGINT from the terminal is supported on all platforms, and can usually be generated with CTRL+C (though this may be configurable). It is not generated when terminal raw mode is enabled.
  • SIGBREAK is delivered on Windows when CTRL+BREAK is pressed, on non-Windows platforms it can be listened on, but there is no way to send or generate it.

Maybe the forks should just be in charge of terminating themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired priority
Projects
None yet
Development

No branches or pull requests

3 participants