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

Question: Will parallel running mess up invocation counts? #1536

Open
papadeltasierra opened this issue Feb 26, 2025 · 0 comments
Open

Question: Will parallel running mess up invocation counts? #1536

papadeltasierra opened this issue Feb 26, 2025 · 0 comments

Comments

@papadeltasierra
Copy link

papadeltasierra commented Feb 26, 2025

I have a set of tests and they currently run sequentially but what I found was this:

  • Test 1 checks "did I call X() exactly once" and passes
  • Test 2 checks "did I call X() exactly once" and fails (the count is 2)
  • Test 3 checks "did I call X() exactly once" and fails (the count is 3)

The fix was simply to ensure that the invocation count get cleared after each test using ...Invocations.Clear().

But now colleagues want to run the tests in parallel and I'm wondering will each parallel instance get its own invocation counts storage or are the parallel instances going to access a common set of counts with chaos being the result?

Back this issue
Back this issue

@papadeltasierra papadeltasierra changed the title Will parallel running mess up invocation counts? Question: Will parallel running mess up invocation counts? Feb 26, 2025
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

1 participant