From 2e5fed9fcac3eb9a058632de38ecf721c9d2d1ed Mon Sep 17 00:00:00 2001 From: Carsten Klein Date: Sat, 6 Oct 2018 21:40:55 +0200 Subject: [PATCH] reduce test timeouts on appveyor since signals have no impact --- lib/tmp.js | 8 ++++---- test/child-process.js | 2 -- test/outband/issue121.js | 4 +++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/tmp.js b/lib/tmp.js index a2192c2..04df104 100644 --- a/lib/tmp.js +++ b/lib/tmp.js @@ -605,12 +605,12 @@ function _safely_install_listener() { rl.on('SIGINT', function () { process.emit('SIGINT'); }); + } else { + process.on('SIGINT', function () { + process.exit(0); + }); } - process.on('SIGINT', function () { - process.exit(0); - }); - process.addListener(EVENT, function _tmp$safe_listener(data) { /* istanbul ignore else */ if (existingListeners.length) { diff --git a/test/child-process.js b/test/child-process.js index ce189e2..8658b29 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -48,8 +48,6 @@ function _doSpawn(commandArgs, cb) { child = spawn(node_path, commandArgs); child.stdin.end(); - // TODO we no longer support node 0.6 - // Cannot use 'close' event because not on node-0.6. function _close() { var stderr = _bufferConcat(stderrBufs).toString(), diff --git a/test/outband/issue121.js b/test/outband/issue121.js index 927f11f..79ec1ef 100644 --- a/test/outband/issue121.js +++ b/test/outband/issue121.js @@ -11,6 +11,7 @@ tmp.setGracefulCleanup(); // https://github.com/raszi/node-tmp/issues/121 module.exports = function (signal) { + try { fixture.apply(this, [tmp.dirSync({ unsafeCleanup: true }), tmp]); } @@ -20,7 +21,8 @@ module.exports = function (signal) { } // make sure that the process keeps running - setTimeout(function () {}, 1000000); + setTimeout(function () {}, 10000); + // we will now end this process, triggering tmp's exit handler this.kill(signal); };