Skip to content

Commit

Permalink
test: fix test-repl timeout and tmpdir refresh
Browse files Browse the repository at this point in the history
PR-URL: #25425
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
  • Loading branch information
mscdex authored and BethGriggs committed Apr 29, 2019
1 parent 814f261 commit 637e876
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/parallel/test-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');
const tmpdir = require('../common/tmpdir');
const assert = require('assert');
const net = require('net');
const repl = require('repl');
Expand Down Expand Up @@ -823,6 +824,8 @@ function startUnixRepl() {
resolveReplServer(replServer);
}));

tmpdir.refresh();

server.listen(common.PIPE, common.mustCall(() => {
const client = net.createConnection(common.PIPE);

Expand Down Expand Up @@ -852,7 +855,7 @@ function event(ee, expected) {
const data = inspect(expected, { compact: false });
const msg = `The REPL did not reply as expected for:\n\n${data}`;
reject(new Error(msg));
}, 500);
}, common.platformTimeout(500));
ee.once('data', common.mustCall((...args) => {
clearTimeout(timeout);
resolve(...args);
Expand Down

0 comments on commit 637e876

Please sign in to comment.