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 be0bb5f

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: fix unreliable known_issues test
`test-stdout-buffer-flush-on-exit` was not failing reliably on POSIX machines and not failing at all on Windows. Revised test fails reliably on POSIX and is skipped (in CI) on Windows where the issue does not exist. Fixes: #6527 PR-URL: #6555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joao Reis <reis@janeasystems.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent 216486c commit be0bb5f
Copy full SHA for be0bb5f

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+31
-4
lines changed
Open diff view settings
Collapse file
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
prefix known_issues
2+
3+
# If a known issue does not apply to a platform, list the test name in the
4+
# appropriate section below, without ".js", followed by ": SKIP". Example:
5+
# sample-test : SKIP
6+
7+
[true] # This section applies to all platforms
8+
9+
[$system==win32]
10+
test-stdout-buffer-flush-on-exit: SKIP
11+
12+
[$system==linux]
13+
14+
[$system==macos]
15+
16+
[$system==solaris]
17+
18+
[$system==freebsd]
19+
20+
[$system==aix]
Collapse file

‎test/known_issues/test-stdout-buffer-flush-on-exit.js‎

Copy file name to clipboardExpand all lines: test/known_issues/test-stdout-buffer-flush-on-exit.js
+11-4Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,23 @@ require('../common');
55
const assert = require('assert');
66
const execSync = require('child_process').execSync;
77

8-
const longLine = 'foo bar baz quux quuz aaa bbb ccc'.repeat(65536);
8+
const lineSeed = 'foo bar baz quux quuz aaa bbb ccc';
99

1010
if (process.argv[2] === 'child') {
11+
const longLine = lineSeed.repeat(parseInt(process.argv[4], 10));
1112
process.on('exit', () => {
1213
console.log(longLine);
1314
});
1415
process.exit();
1516
}
1617

17-
const cmd = `${process.execPath} ${__filename} child`;
18-
const stdout = execSync(cmd).toString().trim();
18+
[16, 18, 20].forEach((exponent) => {
19+
const bigNum = Math.pow(2, exponent);
20+
const longLine = lineSeed.repeat(bigNum);
21+
const cmd = `${process.execPath} ${__filename} child ${exponent} ${bigNum}`;
22+
const stdout = execSync(cmd).toString().trim();
23+
24+
assert.strictEqual(stdout, longLine, `failed with exponent ${exponent}`);
25+
});
26+
1927

20-
assert.strictEqual(stdout, longLine);

0 commit comments

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