-
Notifications
You must be signed in to change notification settings - Fork 220
JSON Formatter is not thread safe #230
Comments
I don't think we'll attempt to make any reporters thread safe. I think it's easier to fix Cucumber so it only accesses reporters from a single thread. WDYT? |
Fixing the internals of cucumber-jvm to support multithreading while maintaining the committed to api for reporters/formatters will be difficult at best (some of the implicit contracts about ordering will need to be broken). I'd rather see cucumber-jvm execute in a thread safe way. To get there, it might be interesting to attempt this by making the json formatter, have it act as an intermediary holder of state, until passing it off to other real formatters. Internal state storage needs to happen somewhere.... the json reporter could become a report aggregator and proxy. Refactor-rinse-repeat? |
in Gherkin library, they just need to move to google Gson, whivch is maintaining a ThreadLoacl, instead of their Gson, which uses a HashMap |
When running Cucumber tests in parallel only the last RunCukes.java class to be executed writes to the json report. This is a problem for anyone that consumes the report downstream. @rexhoffman mentioned this would be easy to do.
The text was updated successfully, but these errors were encountered: