From c5c7ae8e14d77b5640487d8716e3037975c46037 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 26 Mar 2016 19:33:48 -0700 Subject: [PATCH] test: add known_issues test for GH-2148 PR-URL: https://github.com/nodejs/node/pull/5920 Refs: https://github.com/nodejs/node/issues/2148 Reviewed-By: Brian White --- .../test-stdout-buffer-flush-on-exit.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/known_issues/test-stdout-buffer-flush-on-exit.js diff --git a/test/known_issues/test-stdout-buffer-flush-on-exit.js b/test/known_issues/test-stdout-buffer-flush-on-exit.js new file mode 100644 index 00000000000000..f4ea0b5e01b2e1 --- /dev/null +++ b/test/known_issues/test-stdout-buffer-flush-on-exit.js @@ -0,0 +1,20 @@ +'use strict'; +// Refs: https://github.com/nodejs/node/issues/2148 + +require('../common'); +const assert = require('assert'); +const execSync = require('child_process').execSync; + +const longLine = 'foo bar baz quux quuz aaa bbb ccc'.repeat(65536); + +if (process.argv[2] === 'child') { + process.on('exit', () => { + console.log(longLine); + }); + process.exit(); +} + +const cmd = `${process.execPath} ${__filename} child`; +const stdout = execSync(cmd).toString().trim(); + +assert.strictEqual(stdout, longLine);