From f6fdd948076a6d6da1771917d2dcf77d28cecef2 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Thu, 29 Mar 2018 14:06:13 +0300 Subject: [PATCH] qa/tasks/qemu: add a parameter to wait for workloads detect qemu finished In the case when a workload needs to detect qemu finished by running a check with a periodicity of N sec it needs to set time_wait to 2 * N in order to avoid races on finish. Signed-off-by: Mykola Golub (cherry picked from commit af15b2cef46c8d3ab1f9770601ae1abfe9c6b300) Conflicts: qa/tasks/qemu.py - trivial resolution --- qa/tasks/qemu.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qa/tasks/qemu.py b/qa/tasks/qemu.py index f75ed97a6737c..488b191021b66 100644 --- a/qa/tasks/qemu.py +++ b/qa/tasks/qemu.py @@ -6,6 +6,7 @@ from cStringIO import StringIO import contextlib import logging import os +import time from teuthology import misc as teuthology from teuthology import contextutil @@ -353,6 +354,7 @@ def run_qemu(ctx, config): cachemode=cachemode, ), ]) + time_wait = client_config.get('time_wait', 0) log.info('starting qemu...') procs.append( @@ -370,6 +372,11 @@ def run_qemu(ctx, config): log.info('waiting for qemu tests to finish...') run.wait(procs) + if time_wait > 0: + log.debug('waiting {time_wait} sec for workloads detect finish...'.format( + time_wait=time_wait)); + time.sleep(time_wait) + log.debug('checking that qemu tests succeeded...') for client in config.iterkeys(): (remote,) = ctx.cluster.only(client).remotes.keys() -- 2.39.5