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
Fix a race condition in TestNodeLoadFromExistingTaints
TestNodeLoadFromExistingTaints creates a currentTime variable set to time.Now(),
and a bunch of test objects with time values offset from that variable. This is
all standard practice, but then the test iterates over test cases, calls t.Parallel(),
and overwrites currentTime with time.Now() again. This makes go test -race fail,
because multiple goroutines are writing currentTime at once. It also
doesn't seem to make sense in the context of the test, because the other
test objects are still offset from the original value.
Removing the second write to currentTime seems to be the correct fix here. Also
renamed one import because it collided with a local variable name used throughout
this test file.
0 commit comments