0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

test: remove invalid test

`test/known_issues/test-stdout-buffer-flush-on-exit.js` is invalid. The
behavior seen currently (with the test failing) is in accordance with
documentation which indicates that calling `process.exit()` may mean
scheduled asynchronous I/O does not happen. The documentation also
indicates that `process.stdout` is asynchronous when it is a POSIX pipe.

PR-URL: https://github.com/nodejs/node/pull/15320
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rich Trott 2017-09-10 10:23:38 -07:00 committed by Ruben Bridgewater
parent a172b7c51e
commit 6cfd77338a
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -1,26 +0,0 @@
'use strict';
// Refs: https://github.com/nodejs/node/issues/2148
require('../common');
const assert = require('assert');
const execSync = require('child_process').execSync;
const lineSeed = 'foo bar baz quux quuz aaa bbb ccc';
if (process.argv[2] === 'child') {
const longLine = lineSeed.repeat(parseInt(process.argv[4], 10));
process.on('exit', () => {
console.log(longLine);
});
process.exit();
}
[22, 21, 20, 19, 18, 17, 16, 16, 17, 18, 19, 20, 21, 22].forEach((exponent) => {
const bigNum = Math.pow(2, exponent);
const longLine = lineSeed.repeat(bigNum);
const cmd =
`"${process.execPath}" "${__filename}" child ${exponent} ${bigNum}`;
const stdout = execSync(cmd).toString().trim();
assert.strictEqual(stdout, longLine, `failed with exponent ${exponent}`);
});