-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Test output gets mixed up when run in parallel #13
Comments
What I did is to try easing up this issue by prefixing every line with
|
As mentioned in the original issue, the usecase is to view a summary in the CLI rather a realtime progress report. Without parallel execution the pretty formatter can handle both usecases. With parallel execution this is different. There are several options for this and we generally try to keep implementations in different languages in sync. I'll put this on the agenda for the next contributors call. An option would be prefixing each log line with a sortable identifier. This identifier could be composed of Yet another option would be to make the plugin It could also be an idea to create a second formatter There is also the possibility to make a tool that consumes the output from the messages formatter and feeds it to the pretty formatter. The latter two solutions require that tbe plugin recieces the events in order or sorts them. In Cucumber JVM we have several plugins that must receive their events in order. We solve this by collecting and then sorting the events. Unfortunately this comes at a significant overhead in terms of memory. Additionally Cucumber JVM uses its own events which are sortable. The messages used in the pretty formatter aren't quite as easy to sort (though not impossible). |
Although there don't appear to be any tests for it in this repo, I tried it manually and this formatter works well when cucumber-js is run in I suggest we adopt that strategy for parallel execution too - roll up the output for each scenario and emit it to the console (with the enclosing Ideally I guess we could signal in an earlier message (e.g. |
I like this idea. In single-responsibility terms it would be useful to have a "module" of some kind that can consume a stream of interleaved messages and emit them with the messages about each test case grouped together. We could built it as a javascript function and then potentially also package it as a CLI tool for piping. |
I think I this will work well but when Cucumber gets stuck or takes a long time when executing serially will leave people wondering what scenario they're stuck on. So in addition I would suggest we implement a toggle (like we enable/disable ANSI colors) for parallel execution. Cucumber knows when it run in parallel so it can switch strategies. |
Dear all, |
Any updates on this? |
I don't have time at the moment to own the solution to this, but I would happily pair with a contributor who wants to. You can book a slot with me here. You're also welcome to join us in our community Slack in the #committers channel 😄 where we can chat about it. |
+1. |
Hey requiem202, could you please clarify where did you add this [${testCaseStartedId}] to output console? Feature file / steps / formatter ? |
This issue was initially reported in
cucumber/cucumber-js
as cucumber/cucumber-js#1949. See discussion there why it was moved here.👓 What did you see?
When tests are run with
--parallel
flag, the output (for example, steps description) gets mixed.When run without
--parallel
option:With
--parallel
you can see that scenarios (and steps) are printed as they come from different workers and get mixed:✅ What did you expect to see?
I would expect that each Scenario (or entire Feature, so could be multiple scenarios) would be printed as a whole, one after another.
📦 Which version are you using?
🔬 How could we reproduce it?
I'm coming from Scramjet and we are using Cucumber for running BDD tests in multiple repos. The screenshots are based on tests from https://github.com/scramjetorg/transform-hub. You can reproduce it by running tests from this repo:
Please keep in mind you may need some stuff from setup steps too.
🤔 Anything else?
I'm happy to provide more details/context if needed.
The text was updated successfully, but these errors were encountered: