Skip to content
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

Race Condition in Cucumber FailuresLogger #824

Open
stefxzhou opened this issue Aug 5, 2021 · 2 comments
Open

Race Condition in Cucumber FailuresLogger #824

stefxzhou opened this issue Aug 5, 2021 · 2 comments

Comments

@stefxzhou
Copy link

stefxzhou commented Aug 5, 2021

Found a race condition in FailuresLogger (prepare_io), where it first cleans out the existing log file before appending. The same step to clean out the existing log file is also done in Cucumber::Formatter::Rerun.

When running the tests in parallel, the initialize call of process B can overwrite the failed scenario that were logged by process A that finished eariler, resulting in not all of the failed scenarios being logged at the end.

@grosser
Copy link
Owner

grosser commented Aug 7, 2021

Yeah, we might be able to do something like lock the file and then check it's mtime to decide if it needs cleaning or make all processes wait until the first process has cleaned it, PR welcome!

@oehlschl
Copy link

I've experienced the same, with ParallelTests::Cucumber::FailuresLogger specifically. Often, the failures recorded in the fail are incomplete, or occasionally missing all together. Thanks for the report to validate that this is indeed an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants