Fix: убрал баг с нулевым временем Sleep

This commit is contained in:
Azat Kalmykov 2020-04-03 08:53:06 +00:00 committed by Fedor Korotkiy
parent 94cac076e7
commit 8890479bd2

View file

@ -49,7 +49,7 @@ func TestStaleRead(t *testing.T) {
go func(i int) { go func(i int) {
defer wg.Done() defer wg.Done()
time.Sleep(time.Millisecond * time.Duration(i/N)) time.Sleep(time.Duration(i) * time.Millisecond / time.Duration(N))
for j := 0; j < K; j++ { for j := 0; j < K; j++ {
counterValue := atomic.LoadInt32(&counter) counterValue := atomic.LoadInt32(&counter)
batcherValue := b.Load().(int32) batcherValue := b.Load().(int32)