diff --git a/core/engine.go b/core/engine.go index 1c527357281..51a31ff24aa 100644 --- a/core/engine.go +++ b/core/engine.go @@ -328,6 +328,15 @@ func (e *Engine) processMetrics(globalCtx context.Context, processMetricsAfterRu case <-ticker.C: processSamples() case <-processMetricsAfterRun: + getCachedMetrics: + for { + select { + case sc := <-e.Samples: + sampleContainers = append(sampleContainers, sc) + default: + break getCachedMetrics + } + } e.logger.Debug("Processing metrics and thresholds after the test run has ended...") processSamples() if !e.runtimeOptions.NoThresholds.Bool {