Closed smikulcik closed 3 years ago
Digging in a little more, it seems that the basefmt
in progress mode has a goroutine-local owner
property that is not getting set right... I'm not sure why the formatter is the one to maintain which part of the feature file the runner is on...
thanks for reporting, this needs some refactoring
the correct solution would be to prevent having this owner
node and instead link all gherkin nodes with parent node. this would simplify everything. currently godog uses an older cucumber gherkin version, which does not use protobuf (I do not want to introduce such dependency in this library) most likely I will need to update the current godog version of gherkin.
I wrote a concurrent formatter, and run it in conjunction with the progress formatter. I see the same bug above and was going to open up an issue. I was going to suggest having a pointer to the parent/predecessor node, similar to other AST's i've seen. Not sure if this is the correct way to go about fixing the Node Method. I was able to hack around and make my formatter work for my use case, but would've benefited from the pointer to the parent node in the Node Data structure.
yes @ericmcbride it would be much better to have a predecessor link in all the nodes. though, I sadly do not have time to work on my OS projects, too busy with family and work. Will have to delay the implementation
I wouldn't mind taking a crack at it @l3pp4rd.
you are welcome @ericmcbride in case if you see it is too much trouble, I may merge the https://github.com/DATA-DOG/godog/pull/191 which is not a very clean solution and would impact other formatters if we do support concurrency for them later
Im not sure how difficult this would be yet. A co-worker and I have got pretty intimate with the AST and how it works right now, because we have a specialized use case for our concurrent formatter. Do we want to open up a new Issue, since it is a blurry line if the fix is in scope with this issue?
I believe this has been solved, I ran the code in the issue and it behaves correctly with the latest version of godog.
The summary output has incorrect Scenario Step, and Line number references when running with concurrency.
Actual Output
Expected Output
Setup
using github.com/DATA-DOG/godog 0.7.10
steps_test.go
features/run1.feature
features/run2.feature
It seems that there is some concurrency bug or race condition that yields inconsistent behavior with the Summary