Skip to content

Commit 2174abb

Browse files
committed
Add a configurable wat period for shared resource
It would be beneficial to drop this lower for tests.
1 parent e2d0259 commit 2174abb

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

conf/robottelo.yaml.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ ROBOTTELO:
3131
IGNORE_VALIDATION_ERRORS: false
3232
# Stage docs url
3333
STAGE_DOCS_URL: https://docs.redhat.com
34+
SHARED_RESOURCE_WAIT: 2

robottelo/config/validators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@
330330
default=[],
331331
cast=lambda x: list(map(str, x)),
332332
),
333+
Validator('robottelo.shared_resource_wait', default=60, cast=float),
333334
],
334335
shared_function=[
335336
Validator('shared_function.storage', is_in=('file', 'redis'), default='file'),

robottelo/utils/shared_resource.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
from broker.helpers import FileLock
3131

32+
from robottelo.config import settings
33+
3234

3335
class SharedResourceError(Exception):
3436
"""An exception class for SharedResource errors."""
@@ -120,7 +122,7 @@ def _wait_for_main_watcher(self):
120122
while True:
121123
curr_data = json.loads(self.resource_file.read_text())
122124
if curr_data["main_status"] != "done":
123-
time.sleep(60)
125+
time.sleep(settings.robottelo.shared_resource_wait)
124126
elif curr_data["main_status"] == "action_error":
125127
self._try_take_over()
126128
elif curr_data["main_status"] == "error":

0 commit comments

Comments
 (0)