Skip to content

Commit

Permalink
update the waiting timeout in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqixu committed Oct 24, 2024
1 parent 58b5e73 commit 74a2880
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions client/httpclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ func TestHTTPClientStartWithHeartbeatInterval(t *testing.T) {
eventually(t, func() bool { return atomic.LoadInt64(&rcvCounter) == 1 })

if tt.expectHeartbeats {
// Verify that status report is delivered again. no call is made for next 10ms
assert.Eventually(t, func() bool { return atomic.LoadInt64(&rcvCounter) >= 2 }, 50*time.Second, 10*time.Millisecond)
assert.Eventually(t, func() bool { return atomic.LoadInt64(&rcvCounter) >= 2 }, 5*time.Second, 10*time.Millisecond)
} else {
assert.Never(t, func() bool { return atomic.LoadInt64(&rcvCounter) >= 2 }, 50*time.Millisecond, 10*time.Millisecond)
}
Expand Down
2 changes: 1 addition & 1 deletion client/wsclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestWSClientStartWithHeartbeatInterval(t *testing.T) {
if tt.expectHeartbeats {
assert.Eventually(t, func() bool {
return msgCount.Load() >= 2
}, 50*time.Millisecond, 10*time.Millisecond)
}, 5*time.Second, 10*time.Millisecond)
} else {
assert.Never(t, func() bool {
return msgCount.Load() >= 2
Expand Down

0 comments on commit 74a2880

Please sign in to comment.