mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-02 02:11:19 +08:00
Decrease time.sleep times in tests to save 60 seconds for test-suite run.
This commit is contained in:
@@ -109,8 +109,8 @@ class TestConfiguration(BaseConfiguration):
|
||||
NET_TIMEOUT = 3
|
||||
NET_RETRY_INTERVAL = 1
|
||||
# SCM network-related values, in seconds
|
||||
SCM_NET_TIMEOUT = 3
|
||||
SCM_NET_RETRY_INTERVAL = 1
|
||||
SCM_NET_TIMEOUT = 0.1
|
||||
SCM_NET_RETRY_INTERVAL = 0.1
|
||||
|
||||
KOJI_CONFIG = './conf/koji.conf'
|
||||
KOJI_PROFILE = 'staging'
|
||||
|
||||
@@ -136,8 +136,11 @@ def init(config, session, msg):
|
||||
""" Called whenever a module enters the 'init' state."""
|
||||
# Sleep for a few seconds to make sure the module in the database is committed
|
||||
# TODO: Remove this once messaging is implemented in SQLAlchemy hooks
|
||||
time.sleep(3)
|
||||
build = models.ModuleBuild.from_module_event(session, msg)
|
||||
for i in range(3):
|
||||
build = models.ModuleBuild.from_module_event(session, msg)
|
||||
if build:
|
||||
break
|
||||
time.sleep(1)
|
||||
|
||||
try:
|
||||
mmd = build.mmd()
|
||||
|
||||
@@ -62,14 +62,14 @@ def retry(timeout=conf.net_timeout, interval=conf.net_retry_interval, wait_on=Ex
|
||||
def inner(*args, **kwargs):
|
||||
start = time.time()
|
||||
while True:
|
||||
if (time.time() - start) >= timeout:
|
||||
raise # This re-raises the last exception.
|
||||
try:
|
||||
return function(*args, **kwargs)
|
||||
except wait_on as e:
|
||||
log.warn("Exception %r raised from %r. Retry in %rs" % (
|
||||
e, function, interval))
|
||||
time.sleep(interval)
|
||||
if (time.time() - start) >= timeout:
|
||||
raise # This re-raises the last exception.
|
||||
return inner
|
||||
return wrapper
|
||||
|
||||
|
||||
Reference in New Issue
Block a user