From 99f1e3197285f885a994b001d0d3f8c7360d63f5 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 23 May 2018 23:02:02 -0700 Subject: [PATCH] Revert "test: reduce runtime" This reverts commit 352ae2397434ddde058c14cd357e3bdd1d029cb6. --- .../parallel/test-async-wrap-pop-id-during-load.js | 14 ++++++-------- test/parallel/test-child-process-exec-encoding.js | 8 ++++---- 2 files changed, 10 insertions(+), 12 deletions(-) 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 4cf1ef472b6037..4f39a4fdf01b34 100644 --- a/test/parallel/test-async-wrap-pop-id-during-load.js +++ b/test/parallel/test-async-wrap-pop-id-during-load.js @@ -7,17 +7,15 @@ if (process.argv[2] === 'async') { fn(); throw new Error(); } - return (async function() { await fn(); })(); + (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; } const assert = require('assert'); const { spawnSync } = require('child_process'); -const ret = spawnSync( - process.execPath, - ['--stack_size=50', __filename, 'async'] -); +const ret = spawnSync(process.execPath, [__filename, 'async']); assert.strictEqual(ret.status, 0); -const stderr = ret.stderr.toString('utf8', 0, 2048); -assert.ok(!/async.*hook/i.test(stderr)); -assert.ok(stderr.includes('UnhandledPromiseRejectionWarning: Error'), stderr); +assert.ok(!/async.*hook/i.test(ret.stderr.toString('utf8', 0, 1024))); diff --git a/test/parallel/test-child-process-exec-encoding.js b/test/parallel/test-child-process-exec-encoding.js index d7c059a65ab4d8..781ee51d96dcb2 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`;