internal: cleanup roundrobin_test with cleanup function (#2519)
This PR refactor the code with a simple cleanup function.
This commit is contained in:
@ -66,9 +66,7 @@ func startTestServers(count int) (_ *test, err error) {
|
|||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
for _, s := range t.servers {
|
t.cleanup()
|
||||||
s.Stop()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
for i := 0; i < count; i++ {
|
for i := 0; i < count; i++ {
|
||||||
|
Reference in New Issue
Block a user