Skip to content

Commit

Permalink
Add retry
Browse files Browse the repository at this point in the history
Signed-off-by: Vishakha Kathole <[email protected]>
  • Loading branch information
vkathole authored and openshift-cherrypick-robot committed May 31, 2024
1 parent ef437ff commit 0fb4b01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/cross_functional/kcs/test_selinux_relabel_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from ocs_ci.ocs.exceptions import PodNotCreated, CommandFailed
from ocs_ci.ocs.resources import pod as res_pod
from ocs_ci.ocs.resources.pod import wait_for_pods_to_be_running
from ocs_ci.utility.retry import retry
from ocs_ci.utility.utils import run_cmd
from ocs_ci.utility.templating import dump_data_to_temp_yaml
from ocs_ci.framework.pytest_customization.marks import (
Expand Down Expand Up @@ -267,7 +268,7 @@ def test_selinux_relabel_for_existing_pvc(
self.pod_selector = self.pod_obj.labels.get(constants.DEPLOYMENTCONFIG)

# Leave pod for some time to run since file creation time is longer
waiting_time = 240
waiting_time = 20
log.info(f"Waiting for {waiting_time} seconds")
time.sleep(waiting_time)

Expand Down Expand Up @@ -309,7 +310,9 @@ def test_selinux_relabel_for_existing_pvc(
), f"Pod {self.pod_obj.name} didn't reach to running state"

# Check SeLinux Relabeling is set to false
check_selinux_relabeling(pod_obj=self.pod_obj)
retry((AssertionError), tries=5, delay=10,)(
check_selinux_relabeling
)(pod_obj=self.pod_obj)
log.info(f"SeLinux Relabeling is not happening for the pvc {self.pvc_obj.name}")

# Restart pod after applying fix
Expand Down

0 comments on commit 0fb4b01

Please sign in to comment.