From 61c8b8a801ba9680b5f2faf3086d666c1b8984c6 Mon Sep 17 00:00:00 2001 From: Sir Darkrengarius Date: Wed, 29 Jan 2020 16:24:35 +0300 Subject: [PATCH] Try to fix route group test conn --- pkg/router/route_group_test.go | 8 +++++--- vendor/golang.org/x/net/nettest/conntest.go | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/router/route_group_test.go b/pkg/router/route_group_test.go index 3c58cc46a5..2e33fd456e 100644 --- a/pkg/router/route_group_test.go +++ b/pkg/router/route_group_test.go @@ -3,8 +3,10 @@ package router import ( "context" "fmt" + "golang.org/x/net/nettest" "io" "math/rand" + "net" "strconv" "strings" "sync" @@ -680,7 +682,7 @@ func TestRouteGroup_RemoteAddr(t *testing.T) { } // TODO (Darkren): uncomment and fix -/*func TestRouteGroup_TestConn(t *testing.T) { +func TestRouteGroup_TestConn(t *testing.T) { mp := func() (c1, c2 net.Conn, stop func(), err error) { keys := snettest.GenKeyPairs(2) @@ -740,15 +742,15 @@ func TestRouteGroup_RemoteAddr(t *testing.T) { if err := rg1.Close(); err != nil { //panic(err) } - nEnv.Teardown() cancel() + nEnv.Teardown() } return rg0, rg1, stop, nil } nettest.TestConn(t, mp) -}*/ +} func pushPackets(ctx context.Context, from *transport.Manager, to *RouteGroup) { for { diff --git a/vendor/golang.org/x/net/nettest/conntest.go b/vendor/golang.org/x/net/nettest/conntest.go index 0427987e7d..39cc6a631e 100644 --- a/vendor/golang.org/x/net/nettest/conntest.go +++ b/vendor/golang.org/x/net/nettest/conntest.go @@ -37,9 +37,9 @@ func TestConn(t *testing.T, mp MakePipe) { t.Run("WriteTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testWriteTimeout) }) t.Run("PastTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testPastTimeout) }) t.Run("PresentTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testPresentTimeout) }) - //t.Run("FutureTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testFutureTimeout) }) - //t.Run("CloseTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testCloseTimeout) }) - //t.Run("ConcurrentMethods", func(t *testing.T) { timeoutWrapper(t, mp, testConcurrentMethods) }) + t.Run("FutureTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testFutureTimeout) }) + t.Run("CloseTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testCloseTimeout) }) + t.Run("ConcurrentMethods", func(t *testing.T) { timeoutWrapper(t, mp, testConcurrentMethods) }) } type connTester func(t *testing.T, c1, c2 net.Conn)