Skip to content

Commit

Permalink
fix: change the condition to consider a DV import failed
Browse files Browse the repository at this point in the history
The test `TaskRun fails and DataVolume is modified but does not import
successfully` checks if a DV has failed by asserting several fields
on the DV. One of them is `conditions[cdiv1beta1.DataVolumeBound].Status
== v1.ConditionTrue`. In the current version of CDI, if a DV fails to
fetch the import link, which is the scenario in this test, the
underlining PVC is not bound. Therefore, the test assertion fails even
if the DV has failed to import.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
  • Loading branch information
jcanocan committed Sep 20, 2023
1 parent 1734ff5 commit 43d4233
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/tests/test/dataobject/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func HasDataVolumeFailedToImport(dataVolume *cdiv1beta1.DataVolume) bool {
conditions := getConditionMapDv(dataVolume)
return dataVolume.Status.Phase == cdiv1beta1.ImportInProgress &&
dataVolume.Status.RestartCount > constants.UnusualRestartCountThreshold &&
conditions[cdiv1beta1.DataVolumeBound].Status == v1.ConditionTrue &&
conditions[cdiv1beta1.DataVolumeBound].Status == v1.ConditionFalse &&
conditions[cdiv1beta1.DataVolumeRunning].Status == v1.ConditionFalse &&
conditions[cdiv1beta1.DataVolumeRunning].Reason == constants.ReasonError
}
Expand Down

0 comments on commit 43d4233

Please sign in to comment.