diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index 9dcfbed9..93edeb12 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -15,6 +15,9 @@ from odoo.exceptions import ValidationError from .. import github, exceptions, controllers +STAGING_SLEEP = 20 +"temp hack: add a delay between staging repositories in case there's a race when quickly pushing a repo then its dependency" + _logger = logging.getLogger(__name__) class Project(models.Model): _name = 'runbot_merge.project' @@ -211,10 +214,7 @@ class Project(models.Model): heads[r.name] ) it['gh'].set_ref('staging.{}'.format(branch.name), heads[r.name]) - # temp hack: add a delay between staging repositories - # in case there's a race when quickly pushing a repo - # then its dependency - # time.sleep(20) + time.sleep(STAGING_SLEEP) # creating the staging doesn't trigger a write on the prs # and thus the ->staging taggings, so do that by hand diff --git a/runbot_merge/tests/local.py b/runbot_merge/tests/local.py index da3c2f08..5d315bae 100644 --- a/runbot_merge/tests/local.py +++ b/runbot_merge/tests/local.py @@ -31,6 +31,8 @@ def registry(request): [mod] = env['ir.module.module'].search([('name', '=', 'runbot_merge')]) mod.button_immediate_install() + from odoo.addons.runbot_merge.models import pull_requests + pull_requests.STAGING_SLEEP = 0 yield odoo.registry(db) @pytest.fixture