stop router created by makeNetworkOfAllocators

so that unit tests don't leave garbage behind
This commit is contained in:
Matthias Radestock committed 2016-04-10 11:22:57 +01:00
1 parent 16e5032528
commit 4d352d6eb1
2 files changed
+14 -10

No files matched your search

+4 -1
View File
@@ -232,7 +232,10 @@ func makeNetworkOfAllocators(size int, cidr string) ([]*Allocator, *gossip.TestR
return allocs, gossipRouter, subnet
}
func stopNetworkOfAllocators(allocs []*Allocator) {
func stopNetworkOfAllocators(allocs []*Allocator, gossipRouter *gossip.TestRouter) {
// NB: We must stop the router first since ipam gossip makes
// synchronous calls into the allocator.
gossipRouter.Stop()
for _, alloc := range allocs {
alloc.Stop()
}