Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 272732e

Browse filesBrowse files
Trottrvagg
authored andcommitted
test: fix flaky test-child-process-spawnsync-input
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: #3863 PR-URL: #3889 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 781f8c0 commit 272732e
Copy full SHA for 272732e

File tree

Expand file treeCollapse file tree

2 files changed

+27
-12
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+27
-12
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-child-process-spawnsync-input.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-spawnsync-input.js
-12Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,3 @@ ret = spawnSync(process.execPath, args, { encoding: 'utf8' });
8787
checkSpawnSyncRet(ret);
8888
assert.strictEqual(ret.stdout, msgOut + '\n');
8989
assert.strictEqual(ret.stderr, msgErr + '\n');
90-
91-
options = {
92-
maxBuffer: 1
93-
};
94-
95-
ret = spawnSync(process.execPath, args, options);
96-
97-
assert.ok(ret.error, 'maxBuffer should error');
98-
assert.strictEqual(ret.error.errno, 'ENOBUFS');
99-
// we can have buffers larger than maxBuffer because underneath we alloc 64k
100-
// that matches our read sizes
101-
assert.deepEqual(ret.stdout, msgOutBuf);
Collapse file
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
'use strict';
2+
require('../common');
3+
const assert = require('assert');
4+
5+
const spawnSync = require('child_process').spawnSync;
6+
7+
const msgOut = 'this is stdout';
8+
9+
// This is actually not os.EOL?
10+
const msgOutBuf = new Buffer(msgOut + '\n');
11+
12+
const args = [
13+
'-e',
14+
`console.log("${msgOut}");`
15+
];
16+
17+
const options = {
18+
maxBuffer: 1
19+
};
20+
21+
const ret = spawnSync(process.execPath, args, options);
22+
23+
assert.ok(ret.error, 'maxBuffer should error');
24+
assert.strictEqual(ret.error.errno, 'ENOBUFS');
25+
// We can have buffers larger than maxBuffer because underneath we alloc 64k
26+
// that matches our read sizes
27+
assert.deepEqual(ret.stdout, msgOutBuf);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.