]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/qemu: add a parameter to wait for workloads detect qemu finished
authorMykola Golub <mgolub@suse.com>
Thu, 29 Mar 2018 11:06:13 +0000 (14:06 +0300)
committerNathan Cutler <ncutler@suse.com>
Tue, 3 Apr 2018 09:22:29 +0000 (11:22 +0200)
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 <mgolub@suse.com>
(cherry picked from commit af15b2cef46c8d3ab1f9770601ae1abfe9c6b300)

Conflicts:
qa/tasks/qemu.py - trivial resolution

qa/tasks/qemu.py

index f75ed97a6737ce4de8b8d623b49e96e1e30aebc7..488b191021b66e6394ff9dd172bf8eb51d0e1ffa 100644 (file)
@@ -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()