mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-01 18:01:40 +08:00
Merge #834 Faster SCM tests.
This commit is contained in:
@@ -109,6 +109,9 @@ class TestConfiguration(BaseConfiguration):
|
||||
# Global network-related values, in seconds
|
||||
NET_TIMEOUT = 3
|
||||
NET_RETRY_INTERVAL = 1
|
||||
# SCM network-related values, in seconds
|
||||
SCM_NET_TIMEOUT = 3
|
||||
SCM_NET_RETRY_INTERVAL = 1
|
||||
|
||||
KOJI_CONFIG = './conf/koji.conf'
|
||||
KOJI_PROFILE = 'staging'
|
||||
|
||||
@@ -354,6 +354,14 @@ class Config(object):
|
||||
'type': int,
|
||||
'default': 30,
|
||||
'desc': 'Global network retry interval for read/write operations, in seconds.'},
|
||||
'scm_net_timeout': {
|
||||
'type': int,
|
||||
'default': 60,
|
||||
'desc': 'Network timeout for SCM operations, in seconds.'},
|
||||
'scm_net_retry_interval': {
|
||||
'type': int,
|
||||
'default': 15,
|
||||
'desc': 'Network retry interval for SCM operations, in seconds.'},
|
||||
'no_auth': {
|
||||
'type': bool,
|
||||
'default': False,
|
||||
|
||||
@@ -34,7 +34,7 @@ import tempfile
|
||||
import shutil
|
||||
import datetime
|
||||
|
||||
from module_build_service import log
|
||||
from module_build_service import log, conf
|
||||
from module_build_service.errors import (
|
||||
Forbidden, ValidationError, UnprocessableEntity, ProgrammingError)
|
||||
import module_build_service.utils
|
||||
@@ -129,7 +129,10 @@ class SCM(object):
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
@module_build_service.utils.retry(timeout=60, interval=15, wait_on=UnprocessableEntity)
|
||||
@module_build_service.utils.retry(
|
||||
timeout=conf.scm_net_timeout,
|
||||
interval=conf.scm_net_retry_interval,
|
||||
wait_on=UnprocessableEntity)
|
||||
def _run(cmd, chdir=None, log_stdout=False):
|
||||
proc = sp.Popen(cmd, stdout=sp.PIPE, stderr=sp.PIPE, cwd=chdir)
|
||||
stdout, stderr = proc.communicate()
|
||||
|
||||
Reference in New Issue
Block a user