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 01ffe03

Browse filesBrowse files
lpincaBethGriggs
authored andcommitted
test: deflake child-process-pipe-dataflow
Fixes: #25988 PR-URL: #40838 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 480f0e1 commit 01ffe03
Copy full SHA for 01ffe03

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-child-process-pipe-dataflow.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-pipe-dataflow.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const common = require('../common');
33
const assert = require('assert');
44
const path = require('path');
55
const fs = require('fs');
6-
const os = require('os');
76
const spawn = require('child_process').spawn;
87
const tmpdir = require('../common/tmpdir');
98

@@ -22,12 +21,13 @@ const MB = KB * KB;
2221
const file = path.resolve(tmpdir.path, 'data.txt');
2322
const buf = Buffer.alloc(MB).fill('x');
2423

25-
// Most OS commands that deal with data, attach special
26-
// meanings to new line - for example, line buffering.
27-
// So cut the buffer into lines at some points, forcing
28-
// data flow to be split in the stream.
24+
// Most OS commands that deal with data, attach special meanings to new line -
25+
// for example, line buffering. So cut the buffer into lines at some points,
26+
// forcing data flow to be split in the stream. Do not use os.EOL for \n as
27+
// that is 2 characters on Windows and is sometimes converted to 1 character
28+
// which causes the test to fail.
2929
for (let i = 1; i < KB; i++)
30-
buf.write(os.EOL, i * KB);
30+
buf.write('\n', i * KB);
3131
fs.writeFileSync(file, buf.toString());
3232

3333
cat = spawn('cat', [file]);

0 commit comments

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