Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Oct 31, 2022
1 parent 3b22960 commit cfe8b60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions p2p/transport/webtransport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ func TestSNIIsSent(t *testing.T) {

}

var timeoutErr = errors.New("timeout")
var errTimeout = errors.New("timeout")

func serverSendsBackValidCert(timeSinceUnixEpoch time.Duration, keySeed int64, randomClientSkew time.Duration) error {
if timeSinceUnixEpoch < 0 {
Expand Down Expand Up @@ -648,7 +648,7 @@ func serverSendsBackValidCert(timeSinceUnixEpoch time.Duration, keySeed int64, r

if err != nil {
if _, ok := err.(*quic.IdleTimeoutError); ok {
return timeoutErr
return errTimeout
}
return err
}
Expand All @@ -661,7 +661,7 @@ func TestServerSendsBackValidCert(t *testing.T) {
var maxTimeoutErrors = 10
require.NoError(t, quick.Check(func(timeSinceUnixEpoch time.Duration, keySeed int64, randomClientSkew time.Duration) bool {
err := serverSendsBackValidCert(timeSinceUnixEpoch, keySeed, randomClientSkew)
if err == timeoutErr {
if err == errTimeout {
maxTimeoutErrors -= 1
if maxTimeoutErrors <= 0 {
fmt.Println("Too many timeout errors")
Expand All @@ -685,7 +685,7 @@ func TestServerSendsBackValidCertEveryHour(t *testing.T) {
hours := days * 24
for h := 0; h < hours; h++ {
err := serverSendsBackValidCert(time.Hour*time.Duration(h), 0, 0)
if err == timeoutErr {
if err == errTimeout {
maxTimeoutErrors -= 1
if maxTimeoutErrors <= 0 {
t.Fatalf("Too many timeout errors")
Expand Down

0 comments on commit cfe8b60

Please sign in to comment.