-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Async test being run in parallel despite #[serial] #42
Comments
Misunderstanding. The docs say "Multiple tests with the If you've got any suggestions for improved wording though, that can be fixed. |
@palfrey: Thanks for the clarification! I guess the actual wording is not that important, but I do think it should be mentioned. Here's what I would write (addition in bold):
Regarding my original use case: I have a single test case which needs to be run on its own, i.e. no other test case should run in parallel to it. All other test cases, however, may freely run in parallel with each other. If I understand you correctly then this is not directly achievable using |
In case anyone else stumbles upon this issue: I've solved it using a global @palfrey: I think it would be a nice addition to |
Something to look at in the future, certainly. I'm currently looking at file locking but will see if I can find some time for this after that. |
@palfrey Great. I'll leave this ticket open in case you want to keep it as a feature request for |
I had the same question and issue about mixing Using a The |
FYI @torfsen @nnethercote - there is now a PR #54 that implements It currently breaks on Windows builds, but not for any good reason I can yet figure out |
I've figured out the Windows issue (well mostly), in that apparently it's Condvar's don't always signal properly, and adding a timeout to their waits sorted things. I've also documented AFAIK this works and does all the correct things. I'm going to merge #54 and release 0.7.0 with that in about a week's time if nothing else has been found, but if anyone listening here feels like running that branch against their use cases, it'd be appreciated! |
I have a test case that is marked
#[serial]
and still runs in parallel with another test case.The code:
Both test cases try to acquire the same mutex, but since one of them is marked
#[serial]
I would expect that to work (my real use case is different but hard to boil down to such a simple example). However, here's the output of a test run:From the output we can clearly see that the test cases were running in parallel, and hence one of them failed to obtain the lock.
Is this a bug or a misunderstanding on my side?
The text was updated successfully, but these errors were encountered: