Skip to content

Commit

Permalink
Fix resource wrong status exception (#10493)
Browse files Browse the repository at this point in the history
Signed-off-by: Parag Kamble <[email protected]>
  • Loading branch information
paraggit committed Sep 17, 2024
1 parent 5fedc7e commit 4c25869
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ def factory(
status=constants.STATUS_BOUND,
volume_mode=None,
size_unit="Gi",
wait_for_resource_status_timeout=60,
):
"""
Args:
Expand All @@ -1114,6 +1115,8 @@ def factory(
volume_mode (str): Volume mode for PVC.
eg: volume_mode='Block' to create rbd `block` type volume
size_unit (str): PVC size unit, eg: "Mi"
wait_for_resource_status_timeout (int): Wait in seconds until the
desired PVC status is reached.
Returns:
object: helpers.create_pvc instance.
Expand Down Expand Up @@ -1152,7 +1155,9 @@ def factory(
assert pvc_obj, "Failed to create PVC"

if status:
helpers.wait_for_resource_state(pvc_obj, status)
helpers.wait_for_resource_state(
pvc_obj, status, timeout=wait_for_resource_status_timeout
)
pvc_obj.storageclass = storageclass
pvc_obj.project = project
pvc_obj.access_mode = access_mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def test_encrypted_pvc_no_expansion_option(
storageclass=sc_obj,
size=pvc_size,
status=constants.STATUS_BOUND,
wait_for_resource_status_timeout=120,
)

pod_obj = pod_factory(pvc=pvc_obj)
Expand Down

0 comments on commit 4c25869

Please sign in to comment.