newTestMetricStorage creates a metric storage mock with all required methods stubbed
(t *testing.T, expectCompaction bool)
| 182 | |
| 183 | // newTestMetricStorage creates a metric storage mock with all required methods stubbed |
| 184 | func newTestMetricStorage(t *testing.T, expectCompaction bool) *metric.StorageMock { |
| 185 | metricStorage := metric.NewStorageMock(t) |
| 186 | metricStorage.HistogramObserveMock.Set(func(_ string, _ float64, _ map[string]string, _ []float64) { |
| 187 | }) |
| 188 | // CounterAdd is only called during actual compaction |
| 189 | if expectCompaction { |
| 190 | metricStorage.CounterAddMock.Set(func(_ string, _ float64, _ map[string]string) { |
| 191 | }) |
| 192 | } |
| 193 | // Note: GaugeSet is no longer called during compaction tests since metrics |
| 194 | // are updated asynchronously in a separate goroutine that runs with Start() |
| 195 | return metricStorage |
| 196 | } |
| 197 | |
| 198 | func TestTaskQueueList_AddLast_GreedyMerge(t *testing.T) { |
| 199 | tests := []struct { |
no test coverage detected