15340: Skip metrics update when running tests with no registry.
[arvados.git] / lib / dispatchcloud / worker / pool.go
index 8616d6e9a5d9de42d3b36c966f44362d2b632fbd..201e8aad276eb5f8ca353e3ff8c41fc9dee00f2a 100644 (file)
@@ -789,7 +789,9 @@ func (wp *Pool) sync(threshold time.Time, instances []cloud.Instance) {
                        "WorkerState": wkr.state,
                })
                logger.Info("instance disappeared in cloud")
-               wp.mDisappearances.WithLabelValues(stateString[wkr.state]).Inc()
+               if wp.mDisappearances != nil {
+                       wp.mDisappearances.WithLabelValues(stateString[wkr.state]).Inc()
+               }
                delete(wp.workers, id)
                go wkr.Close()
                notify = true