Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Fix race condition on the shadow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
taik0 committed Jan 6, 2019
1 parent 6b4e477 commit cc20a10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proxy/shadow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestShadowMiddleware(t *testing.T) {
request := &Request{}
p(context.Background(), request)
time.Sleep(100 * time.Millisecond)
if counter != 2 {
if atomic.LoadUint64(&counter) != 2 {
t.Errorf("The shadow proxy should have been called 2 times, not %d", counter)
}
}
Expand Down Expand Up @@ -107,7 +107,7 @@ func TestNewShadowFactory(t *testing.T) {
t.Error(err)
}
time.Sleep(100 * time.Millisecond)
if counter != 2 {
if atomic.LoadUint64(&counter) != 2 {
t.Errorf("The shadow proxy should have been called 2 times, not %d", counter)
}
}

0 comments on commit cc20a10

Please sign in to comment.