From 9d9ea8127e9f03269ad9f6f476bc5bfa231efbd8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 2 Nov 2016 20:06:50 -0700 Subject: [PATCH] test: move timer-dependent test to sequential Timer-dependent tests fail frequently on certain platforms in CI when run in parallel with other tests, likely due to competition for resources. Move test-repl-timeout-throw to sequential to avoid this problem. Also did some minor refactoring (var->const and more use of assert.strictEqual of looser assertions). PR-URL: https://github.com/nodejs/node/pull/9431 Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno Reviewed-By: James M Snell Reviewed-By: Johan Bergstrom --- .../test-repl-timeout-throw.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename test/{parallel => sequential}/test-repl-timeout-throw.js (88%) diff --git a/test/parallel/test-repl-timeout-throw.js b/test/sequential/test-repl-timeout-throw.js similarity index 88% rename from test/parallel/test-repl-timeout-throw.js rename to test/sequential/test-repl-timeout-throw.js index 35bb8967d39a90..0188b3b8c502d8 100644 --- a/test/parallel/test-repl-timeout-throw.js +++ b/test/sequential/test-repl-timeout-throw.js @@ -1,10 +1,10 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var spawn = require('child_process').spawn; +const spawn = require('child_process').spawn; -var child = spawn(process.execPath, [ '-i' ], { +const child = spawn(process.execPath, [ '-i' ], { stdio: [null, null, 2] }); @@ -52,8 +52,8 @@ child.stdout.once('data', function() { }); child.on('close', function(c) { - assert(!c); + assert.strictEqual(c, 0); // make sure we got 3 throws, in the end. var lastLine = stdout.trim().split(/\r?\n/).pop(); - assert.equal(lastLine, '> 3'); + assert.strictEqual(lastLine, '> 3'); });