mirror of https://github.com/lukechilds/node.git
Browse Source
`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>canary-base
Rich Trott
7 years ago
committed by
Ruben Bridgewater
1 changed files with 0 additions and 26 deletions
@ -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}`); |
|
||||
}); |
|
Loading…
Reference in new issue