mirror of
https://github.com/stretchr/testify.git
synced 2025-05-31 11:42:44 +00:00
This change fixes a race condition I discovered when a multithreaded test in a service I work on failed under -race. The included test case simulates that failure (concurrent mutation of a Call with invocations on the mock). The test will fail with a data race if run under the race detector; the new locking ensures that call fields are not accessed without the protection of the parent mutex.