From 4613008148dda1e84b1458059dbc06e0c99a5670 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 6 Feb 2019 11:53:33 +0100 Subject: [PATCH] fix broken tests --- testing/scenarios/command_test.go | 5 +++-- testing/scenarios/feature_test.go | 2 +- testing/scenarios/vmess_test.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/testing/scenarios/command_test.go b/testing/scenarios/command_test.go index c5f9f35c5..ace50ca0f 100644 --- a/testing/scenarios/command_test.go +++ b/testing/scenarios/command_test.go @@ -3,6 +3,7 @@ package scenarios import ( "context" "fmt" + "io" "testing" "time" @@ -264,8 +265,8 @@ func TestCommanderAddRemoveUser(t *testing.T) { common.Must(err) defer CloseAllServers(servers) - if err := testTCPConn(clientPort, 1024, time.Second*5)(); err != nil { - t.Fatal(err) + if err := testTCPConn(clientPort, 1024, time.Second*5)(); err != io.EOF { + t.Fatal("expected error: ", err) } cmdConn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", cmdPort), grpc.WithInsecure(), grpc.WithBlock()) diff --git a/testing/scenarios/feature_test.go b/testing/scenarios/feature_test.go index 51caa82a2..454b2a616 100644 --- a/testing/scenarios/feature_test.go +++ b/testing/scenarios/feature_test.go @@ -537,7 +537,7 @@ func TestUDPConnection(t *testing.T) { servers, err := InitializeServerConfigs(clientConfig) common.Must(err) - CloseAllServers(servers) + defer CloseAllServers(servers) if err := testUDPConn(clientPort, 1024, time.Second*5)(); err != nil { t.Error(err) diff --git a/testing/scenarios/vmess_test.go b/testing/scenarios/vmess_test.go index c080f3b4d..9fe997780 100644 --- a/testing/scenarios/vmess_test.go +++ b/testing/scenarios/vmess_test.go @@ -452,7 +452,7 @@ func TestVMessGCMUDP(t *testing.T) { servers, err := InitializeServerConfigs(serverConfig, clientConfig) common.Must(err) - CloseAllServers(servers) + defer CloseAllServers(servers) var errg errgroup.Group for i := 0; i < 10; i++ {