Skip to content

Commit 8747ba3

Browse files
committed
test(e2e): pin the importer restarts an unreachable VMDisk reports
The kubernetes-nodes guard and the image option list call an import failing once its importer has restarted three times and is not running, and the vm-disk guard once it has restarted three times, 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 4af689f commit 8747ba3

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

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

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

0 commit comments

Comments
 (0)