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
Replace process.exit() with process.exitCode #889
Comments
Can you wait for the logger to finish in a hook / step definition? I remember warly one there were many cases where cucumber-js wouldn't exit as it was waiting for everything to exit the event loop |
The current workaround I'm using is an arbitrary I thought about it hanging forever, but wouldn't timeout on individual steps take care of anything infinite? There must be a graceful way to request an exit with timeout in Node without terminating immediately.
|
I'm hesitant to do this as I think other users may experience issues (I'm mainly thinking about those using it for browser testing which is where I remember having it hang). Also that node recommendation only exists on version 6 and 8. It does not exist on version 4 which will be supported until April 2018 (when node drops support). I would be good with adding a CLI option for this though. Something like |
Just want to add that this issue presents a real problem for running Cucumber.js as a child process. I'm doing that with I'll try to submit a pull request for this soon. |
I put forward a pull request, although it's incomplete per @charlierudolph's preferred solution; I didn't do the CLI flag part. I have a workaround for the specific issue I was running into, which was that running Cucumber.js in a child process with the JSON formatter was truncating output after the first stdout stream chunk, because Anybody would be welcome to add onto the above PR, or it may be appropriate to merge it as-is in a few months when version 4 sunsets. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Would it be possible to replace process.exit() calls (a couple in run.js is all I could find) with process.exitCode as per Node.js recommendation linked below. It my case Cucumber.js terminates Node before async file logger has a chance to flush, among other possible pending operations in the event loop.
https://nodejs.org/api/process.html#process_process_exit_code
The text was updated successfully, but these errors were encountered: