Skip to content

Commit e0dcef7

Browse files
committed
test(e2e): pin the importer restarts an unreachable VMDisk reports
The golden image guards call an import failing once its importer has restarted three times and is not running, because CDI keeps an unreachable URL in progress instead of moving it to Failed. Assert that CDI reports both on the DataVolume of the unreachable VMDisk, so a CDI change that stops doing so turns this suite red rather than leaving the guards blind. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent d5751a5 commit e0dcef7

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎hack/e2e-chainsaw/vminstance/chainsaw-test.yaml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,29 @@ spec:
9191
(conditions[?type == 'WorkloadsReady']):
9292
- status: "False"
9393
reason: DataVolumeNotReady
94+
# The golden image guards in the vm-disk and kubernetes-nodes charts and the
95+
# image option list call an import failing once its importer has restarted
96+
# three times and is not running, because CDI keeps an unreachable URL in
97+
# progress instead of moving it to Failed. This pins that CDI does report
98+
# both. The default kubelet back-off before the third restart adds up to 70s
99+
# (10s, 20s, 40s), and the timeout leaves room for the importer's own runs on
100+
# top of that. The count is compared as a string, because Chainsaw v0.2.15
101+
# mis-evaluates numeric literals; 'null' in the list makes an absent count,
102+
# which CDI omits at zero, fail too.
103+
- name: wait-importer-restarts
104+
try:
105+
- assert:
106+
timeout: 4m
107+
resource:
108+
apiVersion: cdi.kubevirt.io/v1beta1
109+
kind: DataVolume
110+
metadata:
111+
name: vm-disk-unreachable
112+
status:
113+
phase: ImportInProgress
114+
(contains(['null', '0', '1', '2'], to_string(restartCount))): false
115+
(conditions[?type == 'Running']):
116+
- status: "False"
94117
---
95118
# VMDisk clone paths: source.image clones a golden image from cozy-public, and
96119
# source.disk clones that disk in turn, so only the golden image downloads.

0 commit comments

Comments
 (0)