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

Give stdout time to flush. #113

Closed
wants to merge 2 commits into from

Conversation

jamestalmage
Copy link
Contributor

@jamestalmage jamestalmage commented May 6, 2016

I do not know why, but I'm suddenly seeing the process exit before the entire report prints.

This fixes the problem. I really wish there was a better way. This just feels wrong.

What I was seeing:

screenshot 2016-05-05 21 11 05

@Qix-
Copy link

Qix- commented May 6, 2016

Not crazy about this approach. We should try the exit module until the root problem is fixed. A time based approach is definitely not the solution here, even temporarily.

@jamestalmage
Copy link
Contributor Author

Nice! Didn't know about the exit module. AVA has been plagued by this, and we resorted to timers there. I'm going to need to fix that!

@Qix-
Copy link

Qix- commented May 6, 2016

@jamestalmage the failing test's assertion error is this:

1. cli » fix option
  AssertionError: 'console.log(0)' === 'console.log(0);'
    _callee$ (cli.js:12:4)
    _combinedTickCallback (internal/process/next_tick.js:67:7)
    process._tickCallback (internal/process/next_tick.js:98:9)

@jamestalmage
Copy link
Contributor Author

Yes, but why?

That appears to be a test for the --fix option. Can't understand why it's being affected (and only on Windows).

@jamestalmage
Copy link
Contributor Author

Test failures are related to IndigoUnited/node-cross-spawn-async#19

@karinepires
Copy link

I'm having the same error and I've tried to correct it before finding this PR.
I did with the following code (as indicated on node docs), is there any reason to not use it?
process.exitCode = report.errorCount === 0 ? 0 : 1;

@sindresorhus
Copy link
Member

@karinepires This is being fixed in Node.js itself. Just don't use Node.js 6 for now.

@sindresorhus
Copy link
Member

Node.js 6.2.1:

tty: Default to blocking mode for stdio on OS X. A bug fix in libuv 1.9.0, introduced in Node.js v6.0.0, exposed problems with Node's use of non-blocking stdio, particularly on OS X which has a small output buffer. This change should fix CLI applications that have been having problems with output since Node.js v6.0.0 on OS X. The core team is continuing to address stdio concerns that exist across supported platforms and progress can be tracked at nodejs/node#6980. (Jeremiah Senkpiel) #6895 - https://nodejs.org/en/blog/release/v6.2.1/

@Qix-
Copy link

Qix- commented Jun 7, 2016

Nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants