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
The use of testEnded in worker/worker_test.go causes race condition test failures.
Describe the steps to reproduce the behavior.
cd worker
go test -race
results in race condition test failures
Expected behavior.
no race condition test failures
Screenshots.
No response
Operating Environment
any development workstation
Additional Information
The fix is simple: change monitorTest() to accept a channel instead of a boolean pointer, and have it detect test-done using the following in the loop:
if _, ok := <-ch; !ok {
break
}
Calling code creates & passes the channel, and closes the channel to signal test-done.
The text was updated successfully, but these errors were encountered:
There's also a race accessing TestWorker.CommandCount, which can easily be fixed using these instead of direct accesses, in any concurrently executed code:
Describe the bug.
The use of
testEnded
in worker/worker_test.go causes race condition test failures.Describe the steps to reproduce the behavior.
results in race condition test failures
Expected behavior.
no race condition test failures
Screenshots.
No response
Operating Environment
any development workstation
Additional Information
The fix is simple: change
monitorTest()
to accept a channel instead of a boolean pointer, and have it detect test-done using the following in the loop:Calling code creates & passes the channel, and closes the channel to signal test-done.
The text was updated successfully, but these errors were encountered: