Skip to content

Commit

Permalink
warp/handlers: update duration greater than assertion to pass on wind…
Browse files Browse the repository at this point in the history
…ows (#991)
  • Loading branch information
aaronbuchwald authored Nov 16, 2023
1 parent 8beb366 commit 32514d6
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions warp/handlers/signature_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"errors"
"testing"
"time"

"github.com/ava-labs/avalanchego/database/memdb"
"github.com/ava-labs/avalanchego/ids"
Expand Down Expand Up @@ -57,11 +56,11 @@ func TestMessageSignatureHandler(t *testing.T) {
require.EqualValues(t, 1, stats.messageSignatureRequest.Count())
require.EqualValues(t, 1, stats.messageSignatureHit.Count())
require.EqualValues(t, 0, stats.messageSignatureMiss.Count())
require.Greater(t, stats.messageSignatureRequestDuration.Value(), time.Duration(0))
require.Greater(t, stats.messageSignatureRequestDuration.Value(), int64(0))
require.EqualValues(t, 0, stats.blockSignatureRequest.Count())
require.EqualValues(t, 0, stats.blockSignatureHit.Count())
require.EqualValues(t, 0, stats.blockSignatureMiss.Count())
require.EqualValues(t, stats.blockSignatureRequestDuration.Value(), time.Duration(0))
require.EqualValues(t, stats.blockSignatureRequestDuration.Value(), int64(0))
},
},
"unknown message": {
Expand All @@ -74,11 +73,11 @@ func TestMessageSignatureHandler(t *testing.T) {
require.EqualValues(t, 1, stats.messageSignatureRequest.Count())
require.EqualValues(t, 0, stats.messageSignatureHit.Count())
require.EqualValues(t, 1, stats.messageSignatureMiss.Count())
require.Greater(t, stats.messageSignatureRequestDuration.Value(), time.Duration(0))
require.Greater(t, stats.messageSignatureRequestDuration.Value(), int64(0))
require.EqualValues(t, 0, stats.blockSignatureRequest.Count())
require.EqualValues(t, 0, stats.blockSignatureHit.Count())
require.EqualValues(t, 0, stats.blockSignatureMiss.Count())
require.EqualValues(t, stats.blockSignatureRequestDuration.Value(), time.Duration(0))
require.EqualValues(t, stats.blockSignatureRequestDuration.Value(), int64(0))
},
},
}
Expand Down Expand Up @@ -159,11 +158,11 @@ func TestBlockSignatureHandler(t *testing.T) {
require.EqualValues(t, 0, stats.messageSignatureRequest.Count())
require.EqualValues(t, 0, stats.messageSignatureHit.Count())
require.EqualValues(t, 0, stats.messageSignatureMiss.Count())
require.EqualValues(t, stats.messageSignatureRequestDuration.Value(), time.Duration(0))
require.EqualValues(t, stats.messageSignatureRequestDuration.Value(), int64(0))
require.EqualValues(t, 1, stats.blockSignatureRequest.Count())
require.EqualValues(t, 1, stats.blockSignatureHit.Count())
require.EqualValues(t, 0, stats.blockSignatureMiss.Count())
require.Greater(t, stats.blockSignatureRequestDuration.Value(), time.Duration(0))
require.Greater(t, stats.blockSignatureRequestDuration.Value(), int64(0))
},
},
"unknown block": {
Expand All @@ -176,11 +175,11 @@ func TestBlockSignatureHandler(t *testing.T) {
require.EqualValues(t, 0, stats.messageSignatureRequest.Count())
require.EqualValues(t, 0, stats.messageSignatureHit.Count())
require.EqualValues(t, 0, stats.messageSignatureMiss.Count())
require.EqualValues(t, stats.messageSignatureRequestDuration.Value(), time.Duration(0))
require.EqualValues(t, stats.messageSignatureRequestDuration.Value(), int64(0))
require.EqualValues(t, 1, stats.blockSignatureRequest.Count())
require.EqualValues(t, 0, stats.blockSignatureHit.Count())
require.EqualValues(t, 1, stats.blockSignatureMiss.Count())
require.Greater(t, stats.blockSignatureRequestDuration.Value(), time.Duration(0))
require.Greater(t, stats.blockSignatureRequestDuration.Value(), int64(0))
},
},
}
Expand Down

0 comments on commit 32514d6

Please sign in to comment.