Skip to content

Commit 519c82f

Browse files
committed
load counter atomically for assertion
1 parent 10e33d6 commit 519c82f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

trie/dtrie/dtrie_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ func TestIterate(t *testing.T) {
161161
atomic.StoreInt64(&c, 0)
162162
echan = iterate(n, nil)
163163
for _ = range echan {
164-
c++
164+
atomic.AddInt64(&c, 1)
165165
}
166-
assert.Equal(t, int64(1000), c)
166+
assert.Equal(t, int64(1000), atomic.LoadInt64(&c))
167167
}
168168

169169
func TestSize(t *testing.T) {

0 commit comments

Comments
 (0)