mirror of
https://github.com/moby/moby.git
synced 2026-08-13 17:06:44 +00:00
TestRequestReleaseAddressDuplicate gets flagged by go test -race because the same err variable inside the test is assigned to from multiple goroutines without synchronization, which obscures whether or not there are any data races in the code under test. Trouble is, the test _depends on_ the data race to exit the loop if an error occurs inside a spawned goroutine. And the test contains a logical concurrency bug (not flagged by the Go race detector) which can result in false-positive test failures. Because a release operation is logged after the IP is released, the other goroutine could reacquire the address and log that it was reacquired before the release is logged. Fix up the test so it is no longer subject to data races or false-positive test failures, i.e. flakes. Signed-off-by: Cory Snider <csnider@mirantis.com>