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

Interaction With Race Detector #30

Open
fedyakin opened this issue Feb 26, 2016 · 0 comments
Open

Interaction With Race Detector #30

fedyakin opened this issue Feb 26, 2016 · 0 comments

Comments

@fedyakin
Copy link

This library is very handy, but when used in tests of concurrent code will trigger the go race detector.

A very simple case is if you have two tests that both call something like testdb.SetQueryFunc. The first test to run uses the query function in a goroutine, the call to set the query function in the second test can be detected as a race.

The race detector is logically correct; a value was read from and written to by different goroutines with no synchronization. However, this should be safe usage of the testdb library, as the two tests are never run concurrently.

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

No branches or pull requests

1 participant