diff --git a/test/parallel/test-async-wrap-pop-id-during-load.js b/test/parallel/test-async-wrap-pop-id-during-load.js index 4f39a4fdf01b34..4cf1ef472b6037 100644 --- a/test/parallel/test-async-wrap-pop-id-during-load.js +++ b/test/parallel/test-async-wrap-pop-id-during-load.js @@ -7,15 +7,17 @@ if (process.argv[2] === 'async') { fn(); throw new Error(); } - (async function() { await fn(); })(); - // While the above should error, just in case it doesn't the script shouldn't - // fork itself indefinitely so return early. - return; + return (async function() { await fn(); })(); } const assert = require('assert'); const { spawnSync } = require('child_process'); -const ret = spawnSync(process.execPath, [__filename, 'async']); +const ret = spawnSync( + process.execPath, + ['--stack_size=50', __filename, 'async'] +); assert.strictEqual(ret.status, 0); -assert.ok(!/async.*hook/i.test(ret.stderr.toString('utf8', 0, 1024))); +const stderr = ret.stderr.toString('utf8', 0, 2048); +assert.ok(!/async.*hook/i.test(stderr)); +assert.ok(stderr.includes('UnhandledPromiseRejectionWarning: Error'), stderr); diff --git a/test/parallel/test-child-process-exec-encoding.js b/test/parallel/test-child-process-exec-encoding.js index 781ee51d96dcb2..d7c059a65ab4d8 100644 --- a/test/parallel/test-child-process-exec-encoding.js +++ b/test/parallel/test-child-process-exec-encoding.js @@ -1,17 +1,17 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const cp = require('child_process'); const stdoutData = 'foo'; const stderrData = 'bar'; -const expectedStdout = `${stdoutData}\n`; -const expectedStderr = `${stderrData}\n`; if (process.argv[2] === 'child') { // The following console calls are part of the test. console.log(stdoutData); console.error(stderrData); } else { + const assert = require('assert'); + const cp = require('child_process'); + const expectedStdout = `${stdoutData}\n`; + const expectedStderr = `${stderrData}\n`; function run(options, callback) { const cmd = `"${process.execPath}" "${__filename}" child`;