File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed
tests/observability/metrics Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 11import logging
2- from datetime import datetime , timezone
32
43import pytest
54
@@ -42,7 +41,6 @@ class TestKubevirtVmiMigrationMetrics:
4241 ),
4342 ],
4443 )
45- @pytest .mark .jira ("CNV-76682" , run = False )
4644 @pytest .mark .s390x
4745 def test_kubevirt_vmi_migration_metrics (
4846 self ,
@@ -54,16 +52,8 @@ def test_kubevirt_vmi_migration_metrics(
5452 vm_migration_metrics_vmim_scope_class ,
5553 query ,
5654 ):
57- minutes_passed_since_migration_start = (
58- int (datetime .now (timezone .utc ).timestamp ())
59- - timestamp_to_seconds (
60- timestamp = vm_for_migration_metrics_test .vmi .instance .status .migrationState .startTimestamp
61- )
62- ) // 60
6355 wait_for_non_empty_metrics_value (
64- prometheus = prometheus ,
65- metric_name = f"last_over_time({ query .format (vm_name = vm_for_migration_metrics_test .name )} "
66- f"[{ minutes_passed_since_migration_start if minutes_passed_since_migration_start > 10 else 10 } m])" ,
56+ prometheus = prometheus , metric_name = query .format (vm_name = vm_for_migration_metrics_test .name )
6757 )
6858
6959
Original file line number Diff line number Diff line change 4141 TIMEOUT_2MIN ,
4242 TIMEOUT_4MIN ,
4343 TIMEOUT_5MIN ,
44+ TIMEOUT_5SEC ,
4445 TIMEOUT_10SEC ,
4546 TIMEOUT_15SEC ,
4647 TIMEOUT_20SEC ,
@@ -468,7 +469,7 @@ def timestamp_to_seconds(timestamp: str) -> int:
468469def wait_for_non_empty_metrics_value (prometheus : Prometheus , metric_name : str ) -> None :
469470 samples = TimeoutSampler (
470471 wait_timeout = TIMEOUT_5MIN ,
471- sleep = TIMEOUT_30SEC ,
472+ sleep = TIMEOUT_5SEC ,
472473 func = get_metrics_value ,
473474 prometheus = prometheus ,
474475 metrics_name = metric_name ,
You can’t perform that action at this time.
0 commit comments