test: add check in test-signal-handler
* Check that the removed listener is not called. * Opportunistic `==` -> `===` change. PR-URL: https://github.com/nodejs/node/pull/8248 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
0482d6d592
commit
a6d53c6779
@ -22,14 +22,14 @@ var i = 0;
|
|||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
console.log('running process...' + ++i);
|
console.log('running process...' + ++i);
|
||||||
|
|
||||||
if (i == 5) {
|
if (i === 5) {
|
||||||
process.kill(process.pid, 'SIGUSR1');
|
process.kill(process.pid, 'SIGUSR1');
|
||||||
}
|
}
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
// Test on condition where a watcher for SIGNAL
|
// Test on condition where a watcher for SIGNAL
|
||||||
// has been previously registered, and `process.listeners(SIGNAL).length === 1`
|
// has been previously registered, and `process.listeners(SIGNAL).length === 1`
|
||||||
process.on('SIGHUP', function() {});
|
process.on('SIGHUP', function() { common.fail('should not run'); });
|
||||||
process.removeAllListeners('SIGHUP');
|
process.removeAllListeners('SIGHUP');
|
||||||
process.on('SIGHUP', common.mustCall(function() {}));
|
process.on('SIGHUP', common.mustCall(function() {}));
|
||||||
process.kill(process.pid, 'SIGHUP');
|
process.kill(process.pid, 'SIGHUP');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user