From 102aee9b321de0d809628b72b8f4e5c73d3ea896 Mon Sep 17 00:00:00 2001 From: Ning Xie Date: Thu, 13 Dec 2018 09:06:06 +0800 Subject: [PATCH] internal: cleanup roundrobin_test with cleanup function (#2519) This PR refactor the code with a simple cleanup function. --- balancer/roundrobin/roundrobin_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/balancer/roundrobin/roundrobin_test.go b/balancer/roundrobin/roundrobin_test.go index 80c4e2b6..f84c3068 100644 --- a/balancer/roundrobin/roundrobin_test.go +++ b/balancer/roundrobin/roundrobin_test.go @@ -66,9 +66,7 @@ func startTestServers(count int) (_ *test, err error) { defer func() { if err != nil { - for _, s := range t.servers { - s.Stop() - } + t.cleanup() } }() for i := 0; i < count; i++ {