Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
test: retry app creation on failure (#1488)
Browse files Browse the repository at this point in the history
This was causing test failures in CI.

Signed-off-by: Andy Sadler <ansadler@redhat.com>
  • Loading branch information
sadlerap committed Aug 25, 2023
1 parent 39908ed commit e66264b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/acceptance/features/steps/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,15 +568,23 @@ def new_app(self, name, image_name, namespace, bindingRoot=None, asDeploymentCon
cmd = cmd + f" -e SERVICE_BINDING_ROOT={bindingRoot}"
if asDeploymentConfig:
cmd = cmd + " --as-deployment-config=true"
(output, exit_code) = self.cmd.run(cmd)
(output, exit_code) = polling2.poll(lambda: self.cmd.run(cmd),
step=1, timeout=30,
check_success=lambda x: x[1] == 0)
else:
cmd = f"{ctx.cli} create deployment {name} -n {namespace} --image={image_name}"
if bindingRoot:
(output, exit_code) = self.cmd.run(f"{ctx.cli} apply -f -",
self.deployment_template.format(name=name, image_name=image_name,
namespace=namespace, bindingRoot=bindingRoot))
(output, exit_code) = polling2.poll(
lambda: self.cmd.run(f"{ctx.cli} apply -f -",
self.deployment_template.format(name=name,
image_name=image_name,
namespace=namespace,
bindingRoot=bindingRoot)),
step=1, timeout=30,
check_success=lambda x: x[1] == 0)
else:
(output, exit_code) = self.cmd.run(cmd)
(output, exit_code) = polling2.poll(lambda: self.cmd.run(cmd), step=1, timeout=30,
check_success=lambda x: x[1] == 0)
assert exit_code == 0, f"Non-zero exit code ({exit_code}) returned when attempting to create a new app using following command line {cmd}\n: {output}"

def set_label(self, name, label, namespace):
Expand Down

0 comments on commit e66264b

Please sign in to comment.