From 3c78fb548e10c2c1058a962fbcc3545de10ced57 Mon Sep 17 00:00:00 2001 From: Chris Henney Date: Thu, 1 Dec 2016 10:37:18 -0600 Subject: [PATCH 1/3] test: change equal to strictEqual, fix setTimeout --- test/parallel/test-domain-exit-dispose.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-domain-exit-dispose.js b/test/parallel/test-domain-exit-dispose.js index 94b3dbd4ca5a37..f50888db78e92d 100644 --- a/test/parallel/test-domain-exit-dispose.js +++ b/test/parallel/test-domain-exit-dispose.js @@ -26,7 +26,7 @@ function err() { console.error('This should not happen.'); disposalFailed = true; process.exit(1); - }); + }, 0); // this function doesn't exist, and throws an error as a result. err3(); // eslint-disable-line no-undef @@ -41,7 +41,7 @@ function err() { } process.on('exit', function() { - assert.equal(a, 10); - assert.equal(disposalFailed, false); + assert.strictEqual(a, 10); + assert.strictEqual(disposalFailed, false); console.log('ok'); }); From 89b0369dd1ef2772356b5f7aa70a01eed9e77aae Mon Sep 17 00:00:00 2001 From: Chris Henney Date: Fri, 2 Dec 2016 15:20:07 -0600 Subject: [PATCH 2/3] Update timeout delay to 1ms --- test/parallel/test-domain-exit-dispose.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-domain-exit-dispose.js b/test/parallel/test-domain-exit-dispose.js index f50888db78e92d..71ee8bd7fe55ca 100644 --- a/test/parallel/test-domain-exit-dispose.js +++ b/test/parallel/test-domain-exit-dispose.js @@ -26,7 +26,7 @@ function err() { console.error('This should not happen.'); disposalFailed = true; process.exit(1); - }, 0); + }, 1); // this function doesn't exist, and throws an error as a result. err3(); // eslint-disable-line no-undef From 80c2aecf7991728d3efcb3a311f0a6437ff4e834 Mon Sep 17 00:00:00 2001 From: Chris Henney Date: Mon, 5 Dec 2016 23:33:29 -0600 Subject: [PATCH 3/3] Update timeout to use mustCall --- test/parallel/test-domain-exit-dispose.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-domain-exit-dispose.js b/test/parallel/test-domain-exit-dispose.js index 71ee8bd7fe55ca..508cec18dccb7d 100644 --- a/test/parallel/test-domain-exit-dispose.js +++ b/test/parallel/test-domain-exit-dispose.js @@ -1,8 +1,8 @@ 'use strict'; require('../common'); +var common = require('../common'); var assert = require('assert'); var domain = require('domain'); -var disposalFailed = false; // no matter what happens, we should increment a 10 times. var a = 0; @@ -22,11 +22,7 @@ function err() { function err2() { // this timeout should never be called, since the domain gets // disposed when the error happens. - setTimeout(function() { - console.error('This should not happen.'); - disposalFailed = true; - process.exit(1); - }, 1); + setTimeout(common.mustCall(() => {}, 0), 1); // this function doesn't exist, and throws an error as a result. err3(); // eslint-disable-line no-undef @@ -42,6 +38,5 @@ function err() { process.on('exit', function() { assert.strictEqual(a, 10); - assert.strictEqual(disposalFailed, false); console.log('ok'); });