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

Commit

Permalink
Add polling to App.get_generation in tests (#1466)
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Ilario <[email protected]>
  • Loading branch information
filariow authored Aug 9, 2023
1 parent f5c9884 commit d66fbd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/acceptance/features/steps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def base_url(self):
def get_generation(self):
deployment_name = self.openshift.get_deployment_name_in_namespace(
self.format_pattern(self.deployment_name_pattern), self.namespace, resource=self.resource)
return int(self.openshift.get_resource_info_by_jsonpath(self.resource, deployment_name, self.namespace, "{.metadata.generation}"))
generation = polling2.poll(
target=lambda: self.openshift.get_resource_info_by_jsonpath(self.resource, deployment_name, self.namespace, "{.metadata.generation}"),
check_success=lambda x: x is not None,
step=5, timeout=800)
return int(generation)


@step(u'jsonpath "{json_path}" on "{res_name}" should return "{json_value}"')
Expand Down

0 comments on commit d66fbd4

Please sign in to comment.