Closed
Description
As part of the change in #1182 to change the Mock mutex to a pointer, the Mock.On
method was changed to re-construct the mutex each time it is called.
This appears to have also introduced another regression (related to but in addition to #1208): Previously it was safe to call On
concurrently with other operations on a Mock, but now because On
resets that pointer, concurrent calls can race (observed in v1.7.4).
A small repro is attached to tickle the basic issue (go test -race
should suffice).
Arguably it's silly for us to be calling On
concurrently with other operations, but regrettably we have some code that relies on the ability to do so, and it worked before v1.7.4 but no longer does.
Metadata
Assignees
Labels
No labels