@@ -8948,7 +8948,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
8948
8948
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16
8949
8949
`
8950
8950
// Check tracked Prometheus metrics
8951
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
8951
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
8952
8952
8953
8953
// Add new runtime configs
8954
8954
activeSeriesTenantOverride := new (TenantLimitsMock )
@@ -8989,7 +8989,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
8989
8989
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_false_flagbased",user="other_test_user"} 16
8990
8990
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="other_test_user"} 16
8991
8991
`
8992
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
8992
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
8993
8993
8994
8994
// Saving time before second push to avoid purging it before exposing.
8995
8995
currentTime = time .Now ()
@@ -9032,7 +9032,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9032
9032
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_a",user="test_user"} 16
9033
9033
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16
9034
9034
`
9035
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9035
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9036
9036
},
9037
9037
},
9038
9038
"remove runtime overwrite and revert to flag based config" : {
@@ -9082,7 +9082,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9082
9082
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16
9083
9083
`
9084
9084
// Check tracked Prometheus metrics
9085
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9085
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9086
9086
9087
9087
// Remove runtime configs
9088
9088
limits := defaultLimitsTestConfig ()
@@ -9118,7 +9118,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9118
9118
# TYPE cortex_ingester_active_series_loading gauge
9119
9119
cortex_ingester_active_series_loading{user="test_user"} 1
9120
9120
`
9121
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9121
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9122
9122
9123
9123
// Saving time before second push to avoid purging it before exposing.
9124
9124
currentTime = time .Now ()
@@ -9161,7 +9161,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9161
9161
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_false_flagbased",user="test_user"} 16
9162
9162
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16
9163
9163
`
9164
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9164
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9165
9165
},
9166
9166
},
9167
9167
"changing runtime override should result in new metrics" : {
@@ -9199,7 +9199,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9199
9199
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16
9200
9200
`
9201
9201
// Check tracked Prometheus metrics
9202
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9202
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9203
9203
9204
9204
// Change runtime configs
9205
9205
activeSeriesTenantOverride := new (TenantLimitsMock )
@@ -9221,7 +9221,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9221
9221
# TYPE cortex_ingester_active_series_loading gauge
9222
9222
cortex_ingester_active_series_loading{user="test_user"} 1
9223
9223
`
9224
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9224
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9225
9225
9226
9226
// Saving time before second push to avoid purging it before exposing.
9227
9227
currentTime = time .Now ()
@@ -9260,7 +9260,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9260
9260
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_c",user="test_user"} 16
9261
9261
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_d",user="test_user"} 16
9262
9262
`
9263
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9263
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9264
9264
},
9265
9265
},
9266
9266
"should cleanup loading metric at close" : {
@@ -9310,7 +9310,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9310
9310
cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16
9311
9311
`
9312
9312
// Check tracked Prometheus metrics
9313
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9313
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9314
9314
9315
9315
// Remove all configs
9316
9316
limits := defaultLimitsTestConfig ()
@@ -9324,11 +9324,11 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) {
9324
9324
cortex_ingester_active_series_loading{user="test_user"} 1
9325
9325
cortex_ingester_active_series_loading{user="other_test_user"} 1
9326
9326
`
9327
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9327
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9328
9328
ingester .closeAllTSDB ()
9329
9329
expectedMetrics = `
9330
9330
`
9331
- require . NoError (t , testutil . GatherAndCompare ( gatherer , strings . NewReader ( expectedMetrics ) , metricNames ... ) )
9331
+ util_test . AssertGatherAndCompare (t , gatherer , expectedMetrics , metricNames ... )
9332
9332
},
9333
9333
},
9334
9334
}
0 commit comments