Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
boks1971 committed Feb 3, 2022
1 parent 03d0adb commit ad3a0b2
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions handshaker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ func TestHandshaker(t *testing.T) {
}
return true
},
DelayMs: 0,
Delay: 0,
OnFinished: func() {
isClientFinished = true
},
FinishWaitMs: 2000 * time.Millisecond,
FinishWait: 2000 * time.Millisecond,
}

serverEndpoint := TestEndpoint{
Expand All @@ -204,11 +204,11 @@ func TestHandshaker(t *testing.T) {
}
return true
},
DelayMs: 1000 * time.Millisecond,
Delay: 1000 * time.Millisecond,
OnFinished: func() {
isServerFinished = true
},
FinishWaitMs: 2000 * time.Millisecond,
FinishWait: 2000 * time.Millisecond,
}

report := func(t *testing.T) {
Expand Down Expand Up @@ -271,7 +271,7 @@ func TestHandshaker(t *testing.T) {
if clientEndpoint.OnFinished != nil {
clientEndpoint.OnFinished()
}
time.AfterFunc(clientEndpoint.FinishWaitMs, func() {
time.AfterFunc(clientEndpoint.FinishWait, func() {
cancelCli()
})
}
Expand Down Expand Up @@ -302,7 +302,7 @@ func TestHandshaker(t *testing.T) {
if serverEndpoint.OnFinished != nil {
serverEndpoint.OnFinished()
}
time.AfterFunc(serverEndpoint.FinishWaitMs, func() {
time.AfterFunc(serverEndpoint.FinishWait, func() {
cancelSrv()
})
}
Expand Down Expand Up @@ -332,10 +332,10 @@ func TestHandshaker(t *testing.T) {
type packetFilter func(p *packet) bool

type TestEndpoint struct {
Filter packetFilter
DelayMs time.Duration
OnFinished func()
FinishWaitMs time.Duration
Filter packetFilter
Delay time.Duration
OnFinished func()
FinishWait time.Duration
}

func flightTestPipe(ctx context.Context, clientEndpoint TestEndpoint, serverEndpoint TestEndpoint) (*flightTestConn, *flightTestConn) {
Expand All @@ -350,15 +350,15 @@ func flightTestPipe(ctx context.Context, clientEndpoint TestEndpoint, serverEndp
otherEndRecv: chB,
done: ctx.Done(),
filter: clientEndpoint.Filter,
delayMs: clientEndpoint.DelayMs,
delay: clientEndpoint.Delay,
}, &flightTestConn{
handshakeCache: cb,
otherEndCache: ca,
recv: chB,
otherEndRecv: chA,
done: ctx.Done(),
filter: serverEndpoint.Filter,
delayMs: serverEndpoint.DelayMs,
delay: serverEndpoint.Delay,
}
}

Expand All @@ -371,7 +371,7 @@ type flightTestConn struct {

filter packetFilter

delayMs time.Duration
delay time.Duration

otherEndCache *handshakeCache
otherEndRecv chan chan struct{}
Expand All @@ -390,7 +390,7 @@ func (c *flightTestConn) notify(ctx context.Context, level alert.Level, desc ale
}

func (c *flightTestConn) writePackets(ctx context.Context, pkts []*packet) error {
time.Sleep(c.delayMs)
time.Sleep(c.delay)
for _, p := range pkts {
if c.filter != nil && !c.filter(p) {
continue
Expand Down

0 comments on commit ad3a0b2

Please sign in to comment.