Skip to content

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

@papadeltasierra

Description

@papadeltasierra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions