From e4176d70485d3b640c05ea463e7e18d474e8b8fe Mon Sep 17 00:00:00 2001
From: Darien Raymond <admin@v2ray.com>
Date: Sat, 28 Jul 2018 15:43:53 +0200
Subject: [PATCH] fix more tests

---
 testing/scenarios/policy_test.go | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/testing/scenarios/policy_test.go b/testing/scenarios/policy_test.go
index e0d6c29d..7d79b29b 100644
--- a/testing/scenarios/policy_test.go
+++ b/testing/scenarios/policy_test.go
@@ -168,8 +168,6 @@ func TestVMessClosing(t *testing.T) {
 	nBytes, err = conn.Read(resp)
 	assert(err, Equals, io.EOF)
 	assert(nBytes, Equals, 0)
-
-	CloseAllServers(servers)
 }
 
 func TestZeroBuffer(t *testing.T) {
@@ -275,6 +273,7 @@ func TestZeroBuffer(t *testing.T) {
 
 	servers, err := InitializeServerConfigs(serverConfig, clientConfig)
 	assert(err, IsNil)
+	defer CloseAllServers(servers)
 
 	var wg sync.WaitGroup
 	wg.Add(10)
@@ -300,6 +299,4 @@ func TestZeroBuffer(t *testing.T) {
 		}()
 	}
 	wg.Wait()
-
-	CloseAllServers(servers)
 }