diff options
author | Adin Scannell <ascannell@google.com> | 2020-03-25 17:20:16 -0700 |
---|---|---|
committer | Adin Scannell <ascannell@google.com> | 2020-04-08 10:14:34 -0700 |
commit | 867eeb18d8c65019fb755194d5bdf768837f07a8 (patch) | |
tree | ad655bb09e51c27f29b169e422a69458a9ae1044 /pkg/tcpip/stack | |
parent | f888b9ce83c202bb77c1e29c3ee60cc485906536 (diff) |
Remove lostcancel warnings.
Updates #2243
Diffstat (limited to 'pkg/tcpip/stack')
-rw-r--r-- | pkg/tcpip/stack/ndp_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/tcpip/stack/ndp_test.go b/pkg/tcpip/stack/ndp_test.go index bc822e3b1..acb2d4731 100644 --- a/pkg/tcpip/stack/ndp_test.go +++ b/pkg/tcpip/stack/ndp_test.go @@ -3483,7 +3483,8 @@ func TestRouterSolicitation(t *testing.T) { e.Endpoint.LinkEPCapabilities |= stack.CapabilityResolutionRequired waitForPkt := func(timeout time.Duration) { t.Helper() - ctx, _ := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() p, ok := e.ReadContext(ctx) if !ok { t.Fatal("timed out waiting for packet") @@ -3513,7 +3514,8 @@ func TestRouterSolicitation(t *testing.T) { } waitForNothing := func(timeout time.Duration) { t.Helper() - ctx, _ := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() if _, ok := e.ReadContext(ctx); ok { t.Fatal("unexpectedly got a packet") } |