You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: