From: Mykola Golub Date: Thu, 29 Mar 2018 11:06:13 +0000 (+0300) Subject: qa/tasks/qemu: add a parameter to wait for workloads detect qemu finished X-Git-Tag: v12.2.5~38^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=95ade90a1a55e1a0aed6090356c284e4c721aee2;p=ceph.git 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) --- diff --git a/qa/tasks/qemu.py b/qa/tasks/qemu.py index 82252e1e91c..7a1abe8f5e9 100644 --- a/qa/tasks/qemu.py +++ b/qa/tasks/qemu.py @@ -7,6 +7,7 @@ import contextlib import logging import os import yaml +import time from teuthology import misc as teuthology from teuthology import contextutil @@ -407,6 +408,7 @@ def run_qemu(ctx, config): cachemode=cachemode, ), ]) + time_wait = client_config.get('time_wait', 0) log.info('starting qemu...') procs.append( @@ -424,6 +426,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()