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

Doesn't work with Node 4 LTS #9

Open
rpaterson opened this issue Jan 13, 2016 · 3 comments
Open

Doesn't work with Node 4 LTS #9

rpaterson opened this issue Jan 13, 2016 · 3 comments

Comments

@rpaterson
Copy link

Tripwire doesn't seem to work properly with the latest Node 4 LTS (v4.2.4). The example in the README:

process.on('uncaughtException', function (e) {
  console.log('The event loop was blocked for longer than 2000 milliseconds');
  process.exit(1);
});

// set the limit of execution time to 2000 milliseconds
tripwire.resetTripwire(2000);

// execute code that will block the event loop for longer
while(true);

// clear the tripwire (in this case this code is never reached)
tripwire.clearTripwire();

In Node v0.10 it pauses for 2 seconds and then prints The event loop was blocked for longer than 2000 milliseconds to the console before exiting. In Node v4.2.4 it pauses and then exits without printing anything.

In other more complicated examples sometimes I get unexpectedException:

Error: Blocked event loop.
    at Error (native)
    at processImmediate [as _immediateCallback] (timers.js:367:26)

... or ...

TypeError: immediate._onImmediate is not a function
    at processImmediate [as _immediateCallback] (timers.js:383:17)
@rpaterson
Copy link
Author

Note when the process exits the exit code is 0.

@rpaterson
Copy link
Author

(I'm on Linux)

@rpaterson
Copy link
Author

/samples/sample_exceptions.js and /samples/sample_perpertuum_mobile.js do work, but /samples/sample_sandboxing.js does not - it prints only [Malcolm] Ha ha ha! I am taking over your event loop, Albert. Ha ha ha! and then exits with exit code 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant