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

mock: avoid data races when expecting calls #1693

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

johanneswuerbach
Copy link

Instead of modifying the output as proposed in #1598, avoid any kind of output when trying to match calls.

petergardfjall and others added 2 commits January 3, 2025 21:05
Fixes a concurrency issue that would lead to testify mocks producing data races
detected by go test -race. These data races would occur whenever a mock pointer
argument was concurrently modified. The reason being that Arguments.Diff uses
the %v format specifier to get a presentable string for the argument. This also
traverses the pointed-to data structure, which would lead to the data race.

Signed-off-by: Peter Gardfjäll <[email protected]>
Signed-off-by: Johannes Würbach <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants