mirror of https://github.com/lukechilds/node.git
Browse Source
Move portion of `test-child-process-spawnsync-input.js` (that has been flaky on CentOS in CI) to its own file. This allows us to more easily eliminate the cause of the flakiness without affecting other unrelated portions of the test. Fixes: https://github.com/nodejs/node/issues/3863 PR-URL: https://github.com/nodejs/node/pull/3889 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>v5.x
Rich Trott
9 years ago
committed by
Rod Vagg
2 changed files with 27 additions and 12 deletions
@ -0,0 +1,27 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
const assert = require('assert'); |
|||
|
|||
const spawnSync = require('child_process').spawnSync; |
|||
|
|||
const msgOut = 'this is stdout'; |
|||
|
|||
// This is actually not os.EOL?
|
|||
const msgOutBuf = new Buffer(msgOut + '\n'); |
|||
|
|||
const args = [ |
|||
'-e', |
|||
`console.log("${msgOut}");` |
|||
]; |
|||
|
|||
const options = { |
|||
maxBuffer: 1 |
|||
}; |
|||
|
|||
const ret = spawnSync(process.execPath, args, options); |
|||
|
|||
assert.ok(ret.error, 'maxBuffer should error'); |
|||
assert.strictEqual(ret.error.errno, 'ENOBUFS'); |
|||
// We can have buffers larger than maxBuffer because underneath we alloc 64k
|
|||
// that matches our read sizes
|
|||
assert.deepEqual(ret.stdout, msgOutBuf); |
Loading…
Reference in new issue