Skip to content

Commit 7c6b37f

Browse files
committed
test: use spawnSyncAndExitWithoutError, fix overlong comment line
Signed-off-by: kishore280 <[email protected]>
1 parent 6ddc948 commit 7c6b37f

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
'use strict';
22

3-
// Measures the child's actual exit time, not just its 'error' event - the outer spawnSync timeout catches a leaked inner timer.
3+
// Measures the child's actual exit time, not just its 'error' event.
4+
// The outer spawnSync timeout catches a leaked inner timer.
45

56
const common = require('../common');
6-
const assert = require('assert');
7-
const { spawnSync } = require('child_process');
7+
const { spawnSyncAndExitWithoutError } = require('../common/child_process');
88

99
const bugStallMs = common.platformTimeout(10000);
1010
const outerTimeoutMs = common.platformTimeout(2000);
1111

12-
const child = spawnSync(process.execPath, ['-e', `
12+
spawnSyncAndExitWithoutError(process.execPath, ['-e', `
1313
const { spawn } = require('child_process');
1414
const cp = spawn(process.execPath, ['--version'], {
1515
cwd: '/nonexistent/path/that/should/never/exist',
1616
timeout: ${bugStallMs},
1717
});
1818
cp.on('error', () => {});
1919
`], { timeout: outerTimeoutMs });
20-
21-
assert.strictEqual(child.signal, null);
22-
assert.strictEqual(child.status, 0);

0 commit comments

Comments
 (0)