Skip to content
Closed
Changes from 2 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
21 changes: 21 additions & 0 deletions test/known_issues/test-stdout-buffer-flush-on-exit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';
// Refs: https://github.com/nodejs/node/issues/2148

require('../common');
const assert = require('assert');
const execSync = require('child_process').execSync;

const longLine = 'foo bar baz quux quuz aaa bbb ccc'.repeat(65536);

if (process.argv[2] === 'child') {
process.on('exit', () => {
console.log(longLine);
});
process.exit();
}

const stdout = execSync(`${process.execPath} ${__filename} child`)
.toString()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: maybe these would look a little less oddly placed if they were lined up with the first e in execSync()?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe just do this?

const argv = `${process.execPath} ${__filename} child`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks! Nit addressed.

.trim();

assert.strictEqual(stdout, longLine);