Skip to content

Commit

Permalink
Add a configurable wat period for shared resource
Browse files Browse the repository at this point in the history
It would be beneficial to drop this lower for tests.
  • Loading branch information
JacobCallahan committed Feb 12, 2025
1 parent e2d0259 commit 2174abb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions conf/robottelo.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ ROBOTTELO:
IGNORE_VALIDATION_ERRORS: false
# Stage docs url
STAGE_DOCS_URL: https://docs.redhat.com
SHARED_RESOURCE_WAIT: 2
1 change: 1 addition & 0 deletions robottelo/config/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
default=[],
cast=lambda x: list(map(str, x)),
),
Validator('robottelo.shared_resource_wait', default=60, cast=float),
],
shared_function=[
Validator('shared_function.storage', is_in=('file', 'redis'), default='file'),
Expand Down
4 changes: 3 additions & 1 deletion robottelo/utils/shared_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

from broker.helpers import FileLock

from robottelo.config import settings


class SharedResourceError(Exception):
"""An exception class for SharedResource errors."""
Expand Down Expand Up @@ -120,7 +122,7 @@ def _wait_for_main_watcher(self):
while True:
curr_data = json.loads(self.resource_file.read_text())
if curr_data["main_status"] != "done":
time.sleep(60)
time.sleep(settings.robottelo.shared_resource_wait)
elif curr_data["main_status"] == "action_error":
self._try_take_over()
elif curr_data["main_status"] == "error":
Expand Down

0 comments on commit 2174abb

Please sign in to comment.