@@ -8948,7 +8948,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
89488948 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16
89498949 `
89508950 // Check tracked Prometheus metrics
8951- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
8951+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
89528952
89538953 // Add new runtime configs
89548954 activeSeriesTenantOverride := new (TenantLimitsMock )
@@ -8989,7 +8989,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
89898989 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_false_flagbased",user="other_test_user"} 16
89908990 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="other_test_user"} 16
89918991 `
8992- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
8992+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
89938993
89948994 // Saving time before second push to avoid purging it before exposing.
89958995 currentTime = time .Now ()
@@ -9032,7 +9032,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
90329032 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_a",user="test_user"} 16
90339033 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16
90349034 `
9035- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9035+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
90369036 },
90379037 },
90389038 "remove runtime overwrite and revert to flag based config" : {
@@ -9082,7 +9082,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
90829082 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16
90839083 `
90849084 // Check tracked Prometheus metrics
9085- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9085+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
90869086
90879087 // Remove runtime configs
90889088 limits := defaultLimitsTestConfig ()
@@ -9118,7 +9118,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
91189118 # TYPE cortex_ingester_active_series_loading gauge
91199119 cortex_ingester_active_series_loading{user="test_user"} 1
91209120 `
9121- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9121+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
91229122
91239123 // Saving time before second push to avoid purging it before exposing.
91249124 currentTime = time .Now ()
@@ -9161,7 +9161,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
91619161 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_false_flagbased",user="test_user"} 16
91629162 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16
91639163 `
9164- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9164+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
91659165 },
91669166 },
91679167 "changing runtime override should result in new metrics" : {
@@ -9199,7 +9199,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
91999199 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16
92009200 `
92019201 // Check tracked Prometheus metrics
9202- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9202+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
92039203
92049204 // Change runtime configs
92059205 activeSeriesTenantOverride := new (TenantLimitsMock )
@@ -9221,7 +9221,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
92219221 # TYPE cortex_ingester_active_series_loading gauge
92229222 cortex_ingester_active_series_loading{user="test_user"} 1
92239223 `
9224- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9224+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
92259225
92269226 // Saving time before second push to avoid purging it before exposing.
92279227 currentTime = time .Now ()
@@ -9260,7 +9260,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
92609260 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_c",user="test_user"} 16
92619261 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_d",user="test_user"} 16
92629262 `
9263- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9263+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
92649264 },
92659265 },
92669266 "should cleanup loading metric at close" : {
@@ -9310,7 +9310,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
93109310 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16
93119311 `
93129312 // Check tracked Prometheus metrics
9313- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9313+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
93149314
93159315 // Remove all configs
93169316 limits := defaultLimitsTestConfig ()
@@ -9324,11 +9324,11 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
93249324 cortex_ingester_active_series_loading{user="test_user"} 1
93259325 cortex_ingester_active_series_loading{user="other_test_user"} 1
93269326 `
9327- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9327+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
93289328 ingester .closeAllTSDB ()
93299329 expectedMetrics = `
93309330 `
9331- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9331+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
93329332 },
93339333 },
93349334 }
0 commit comments