From 40ed986233cb34f3b7f431856746d763a7f7a7af Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 27 Oct 2014 15:26:36 -0700 Subject: [PATCH] internal.py: report more-accurate info about locked machines Don't hide the fact that there are reserved machines that may cause a scheduled lock request to have to wait. Fixes: 9914 Signed-off-by: Dan Mick --- teuthology/task/internal.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index bb0e7a0061..13e6ab1cdc 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -87,17 +87,19 @@ def lock_machines(ctx, config): raise RuntimeError('Error listing machines') # make sure there are machines for non-automated jobs to run - if len(machines) <= to_reserve and ctx.owner.startswith('scheduled'): + if len(machines) <= to_reserve + how_many and ctx.owner.startswith('scheduled'): if ctx.block: log.info( - 'waiting for more machines to be free (need %s see %s)...', + 'waiting for more machines to be free (need %s + %s, have %s)...', + to_reserve, how_many, len(machines), ) time.sleep(10) continue else: - assert 0, 'not enough machines free' + assert 0, ('not enough machines free; need %s + %s, have %s' % + (to_reserve, how_many, len(machines))) newly_locked = lock.lock_many(ctx, how_many, machine_type, ctx.owner, ctx.archive, os_type, os_version, arch) -- 2.39.5