Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Commit

Permalink
Fix test-only data race in cmdlog/clean test.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamduo committed Mar 15, 2017
1 parent 80bc3bf commit 5a799b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions int/cmdlog/clean_test.go
Expand Up @@ -289,7 +289,8 @@ func TestStartCleaningCycle(t *testing.T) {
StartCleaningCycle(cleaner, fn, 5)
time.Sleep(14 * time.Millisecond)

if atomic.LoadUint32(&n) != 2 {
t.Fatalf("Attempts got=%d, want=2", n)
got := atomic.LoadUint32(&n)
if got != 2 {
t.Fatalf("Attempts got=%d, want=2", got)
}
}

0 comments on commit 5a799b8

Please sign in to comment.