@@ -85,19 +85,6 @@ func TestUserWorkloadMonitoringInvalidConfig(t *testing.T) {
8585func TestUserWorkloadMonitoringMetrics (t * testing.T ) {
8686 setupUserWorkloadAssetsWithTeardownHook (t , f )
8787
88- uwmCM := f .BuildUserWorkloadConfigMap (t ,
89- `prometheus:
90- enforcedTargetLimit: 10
91- volumeClaimTemplate:
92- spec:
93- resources:
94- requests:
95- storage: 2Gi
96- ` ,
97- )
98- f .MustCreateOrUpdateConfigMap (t , uwmCM )
99- defer f .MustDeleteConfigMap (t , uwmCM )
100-
10188 f .AssertStatefulSetExistsAndRollout ("prometheus-user-workload" , f .UserWorkloadMonitoringNs )(t )
10289 if err := deployUserApplication (f ); err != nil {
10390 t .Fatal (err )
@@ -145,13 +132,7 @@ func TestUserWorkloadMonitoringAlerting(t *testing.T) {
145132 setupUserWorkloadAssetsWithTeardownHook (t , f )
146133
147134 uwmCM := f .BuildUserWorkloadConfigMap (t ,
148- fmt .Sprintf (`prometheus:
149- enforcedTargetLimit: 10
150- volumeClaimTemplate:
151- spec:
152- resources:
153- requests:
154- storage: 2Gi
135+ fmt .Sprintf (`
155136namespacesWithoutLabelEnforcement:
156137- %s
157138` , notEnforcedNs ),
@@ -217,19 +198,6 @@ userWorkload:
217198func TestUserWorkloadMonitoringOptOut (t * testing.T ) {
218199 setupUserWorkloadAssetsWithTeardownHook (t , f )
219200
220- uwmCM := f .BuildUserWorkloadConfigMap (t ,
221- `prometheus:
222- enforcedTargetLimit: 10
223- volumeClaimTemplate:
224- spec:
225- resources:
226- requests:
227- storage: 2Gi
228- ` ,
229- )
230- f .MustCreateOrUpdateConfigMap (t , uwmCM )
231- defer f .MustDeleteConfigMap (t , uwmCM )
232-
233201 f .AssertStatefulSetExistsAndRollout ("prometheus-user-workload" , f .UserWorkloadMonitoringNs )(t )
234202 if err := deployUserApplication (f ); err != nil {
235203 t .Fatal (err )
@@ -249,19 +217,6 @@ func TestUserWorkloadMonitoringOptOut(t *testing.T) {
249217func TestUserWorkloadMonitoringGrpcSecrets (t * testing.T ) {
250218 setupUserWorkloadAssetsWithTeardownHook (t , f )
251219
252- uwmCM := f .BuildUserWorkloadConfigMap (t ,
253- `prometheus:
254- enforcedTargetLimit: 10
255- volumeClaimTemplate:
256- spec:
257- resources:
258- requests:
259- storage: 2Gi
260- ` ,
261- )
262- f .MustCreateOrUpdateConfigMap (t , uwmCM )
263- defer f .MustDeleteConfigMap (t , uwmCM )
264-
265220 for _ , scenario := range []struct {
266221 name string
267222 f func (* testing.T )
@@ -394,9 +349,9 @@ func assertMetricsForMonitoringComponents(t *testing.T) {
394349 } {
395350 t .Run (service , func (t * testing.T ) {
396351 f .ThanosQuerierClient .WaitForQueryReturn (
397- // To avoid making the test wait for more than lookback-delta in case Prometheus
398- // wasn't able to write stale markers (because it was down), reduce the lookup period.
399- t , time .Minute , fmt .Sprintf (`count(last_over_time(up{service="%s",namespace="openshift-user-workload-monitoring"}[1m]) == 1)` , service ),
352+ // To avoid having to make the test run for more than lookback-delta in case Prometheus
353+ // wasn't able to write stale markers (because it was down), reduce the lookup period and the timeout .
354+ t , 3 * time .Minute , fmt .Sprintf (`count(last_over_time(up{service="%s",namespace="openshift-user-workload-monitoring"}[1m]) == 1)` , service ),
400355 func (v float64 ) error {
401356 if v == float64 (expected ) {
402357 return nil
0 commit comments