diff options
| author | Mel <einebeere@gmail.com> | 2022-06-14 10:08:27 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-14 10:08:27 +0000 |
| commit | 1cb973f84473f5c1f65132b39a21e991093cc868 (patch) | |
| tree | a7803aeaf3cae01bae9b279755b01455ca67ced1 /pkg/discord/gateway/heartbeat_test.go | |
| parent | 5bee62d524bd3b4ac8cb2b081e508d518113d25c (diff) | |
| download | jinx-1cb973f84473f5c1f65132b39a21e991093cc868.tar.zst jinx-1cb973f84473f5c1f65132b39a21e991093cc868.zip | |
Adjust error margin for heartbeat test
Diffstat (limited to 'pkg/discord/gateway/heartbeat_test.go')
| -rw-r--r-- | pkg/discord/gateway/heartbeat_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/discord/gateway/heartbeat_test.go b/pkg/discord/gateway/heartbeat_test.go index f148d35..18862cf 100644 --- a/pkg/discord/gateway/heartbeat_test.go +++ b/pkg/discord/gateway/heartbeat_test.go @@ -16,7 +16,7 @@ func TestHeartBeats(t *testing.T) { // This is probably a flaky test, if it fails, change the error margin. // Also, Discord sets it's own interval acceptance margins, perhaps we should // use that instead of a hardcoded error margin. - errorMargin := 1 * time.Millisecond + errorMargin := 2 * time.Millisecond logger := zerolog.New(zerolog.NewTestWriter(t)) g := mocks.Gateway{} @@ -39,7 +39,7 @@ func TestHeartBeats(t *testing.T) { <-beats jitter := time.Since(start) - require.Less(t, jitter, interval, "the first jitter heartbeat should happen before the interval") + require.Less(t, jitter, interval+errorMargin, "the first jitter heartbeat should happen before the interval") start = time.Now() <-beats |
