[FIX] runbot_merge: re-enable staging delay

staging delay was mistakenly commented in
bb664455ec

Also modified testing fixtures so the staging delay is not enabled when
running tests locally: on my box it increases the local runtime from
~70s to ~1500s (20s/staging, ~1 staging/test, 73 tests)
This commit is contained in:
Xavier Morel 2018-09-21 15:57:16 +02:00
parent f3383daf60
commit e6a1a0634a
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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