Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix unreliable known_issues test #6555

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/known_issues/known_issues.status
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
prefix known_issues

# If a known issue does not apply to a platform, list the test name in the
# appropriate section below, without ".js", followed by ": SKIP". Example:
# sample-test : SKIP

[true] # This section applies to all platforms

[$system==win32]
test-stdout-buffer-flush-on-exit: SKIP

[$system==linux]

[$system==macos]

[$system==solaris]

[$system==freebsd]

[$system==aix]
15 changes: 11 additions & 4 deletions test/known_issues/test-stdout-buffer-flush-on-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ require('../common');
const assert = require('assert');
const execSync = require('child_process').execSync;

const longLine = 'foo bar baz quux quuz aaa bbb ccc'.repeat(65536);
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();
}

const cmd = `${process.execPath} ${__filename} child`;
const stdout = execSync(cmd).toString().trim();
[16, 18, 20].forEach((exponent) => {
const bigNum = Math.pow(2, exponent);
const longLine = lineSeed.repeat(bigNum);
const cmd = `${process.execPath} ${__filename} child ${exponent} ${bigNum}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the exponent argument is not needed anymore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, that's true, but I left it in for the assert message.

const stdout = execSync(cmd).toString().trim();

assert.strictEqual(stdout, longLine, `failed with exponent ${exponent}`);
});


assert.strictEqual(stdout, longLine);