Commit 3bce173
authored
Fixed return None on missing metric for filter_metric_by_component (#3645)
##### Short description:
`test_cdi_json_patch_metrics` uses the function
`filter_metric_by_component` which returns None instead of 0 if the
metric isn't found. The None value is used in later addition in
`wait_for_metrics_value_update`, causing a type error
##### More details:
having trouble reproducing issue on local cluster, so trying to
future-proof with a warning and new return statement
##### What this PR does / why we need it:
part of detecting early 4.99 failures for 4.22.0
##### Which issue(s) this PR fixes:
##### Special notes for reviewer:
##### jira-ticket:
https://issues.redhat.com/browse/CNV-78331
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Improved metric handling in test utilities: missing or malformed
metrics now log a warning and return a safe default numeric value.
* Sampling logic tightened to ignore empty or falsy samples before
performing comparisons to prevent false positives.
* Timeout failures are now logged and re-raised so test harnesses
reliably detect and handle timing issues.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent f9619a4 commit 3bce173
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
81 | | - | |
| 88 | + | |
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
| |||
0 commit comments