14360: Fix test case.
[arvados.git] / lib / dispatchcloud / dispatcher.go
index bea6ed3cc5251cb5f73059b8a912a8506620f807..81ad0ed3fa2b5924fdf1a55a3603dbfc88827fef 100644 (file)
@@ -35,6 +35,7 @@ const (
 type pool interface {
        scheduler.WorkerPool
        Instances() []worker.InstanceView
+       Stop()
 }
 
 type dispatcher struct {
@@ -149,6 +150,7 @@ func (disp *dispatcher) initialize() {
 func (disp *dispatcher) run() {
        defer close(disp.stopped)
        defer disp.instanceSet.Stop()
+       defer disp.pool.Stop()
 
        staleLockTimeout := time.Duration(disp.Cluster.Dispatch.StaleLockTimeout)
        if staleLockTimeout == 0 {