Closed kmulvey closed 5 years ago
@kmulvey Thanks for the PR. Two questions:
Activate()
is also a non-threadsafe (and global) operation so using Activate
and Deactivate
for setup/teardown of each testcase will still cause issues for parallel tests as far as I can tell. How are you getting around this problem?In short, this library is not really designed to be used with parallel testing, but if this PR can help with a specific use case, it probably does not hurt to merge it. Let me know what you think.
Locking has been introduced in March 2017
without locking the map you will get concurrent map write panics if you have more than one test running in t.Parallel() that are setting up mocks