As part of our integration tests framework, we have some form of metric-based assertion. At the moment, is it not capable of waiting on a metric. When the metric is not there as it fetches /metrics it will bail out saying that the metric is not present even though the metric could eventually be there after a certain async action completes.
In https://github.com/cortexproject/cortex/pull/2960/files#r464597389 we discussed about adding an option to the WaitMetric method that allows us to wait on a metric as a solution to this problem.
#2522 provides a foundation for this work given the ability to wait on a condition could be added as an option.