Skip to content

Commit

Permalink
Update TestGetCurrentBucketStartTimeIsWithinBounds to include clockSk…
Browse files Browse the repository at this point in the history
…ew calculation
  • Loading branch information
MarcoPolo committed Oct 31, 2022
1 parent cfe8b60 commit e7455e4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions p2p/transport/webtransport/cert_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func TestGetCurrentBucketStartTimeIsWithinBounds(t *testing.T) {
// Start a bit further in the future to avoid edge cases around epoch
timeSinceUnixEpoch += time.Hour * 24 * 365
start := time.UnixMilli(timeSinceUnixEpoch.Milliseconds())
start = start.Add(-clockSkewAllowance)

bucketStart := getCurrentBucketStartTime(start, offset)
return !bucketStart.After(start.Add(-clockSkewAllowance)) || bucketStart.Equal(start.Add(-clockSkewAllowance))
Expand Down

0 comments on commit e7455e4

Please sign in to comment.