internal: cleanup roundrobin_test with cleanup function (#2519)

This PR refactor the code with a simple cleanup function.
This commit is contained in:
Ning Xie
2018-12-13 09:06:06 +08:00
committed by Menghan Li
parent 14de8b69c2
commit 102aee9b32

View File

@ -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++ {