We need to flush our FileWriter's created in cucumber-core #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
System.exit(int) doesn't appear to ensure that our FileWriters are flushed, and so any output configured to go to files, doesn't.
I found this bug (#172) when running against our project, barfing out JSON to a file to see what I could do with that in terms of reporting, and or giving it to someone else for ingestion.
Then, noticing that it didn't output all the data, I tried adding it to the jruby project in cucumber-jvm, just to have a smallish starting point. Turns out nothing was making it into the output file, but if I barfed to the console, everything showed up! Our file writers weren't being flushed.
This adds a shutdown hook only for the filewriters we create, and calls flush on them. I suppose it could call close, but flushing them seems to get the job done.
Opinions? Should we be doing this entirely differently?