Skip to content

Commit

Permalink
qa/tasks/qemu: add a parameter to wait for workloads detect qemu fini…
Browse files Browse the repository at this point in the history
…shed

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 <[email protected]>
  • Loading branch information
trociny committed Mar 29, 2018
1 parent 67e0165 commit af15b2c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions qa/tasks/qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
import os
import yaml
import time

from teuthology import misc as teuthology
from teuthology import contextutil
Expand Down Expand Up @@ -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(
Expand All @@ -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()
Expand Down

0 comments on commit af15b2c

Please sign in to comment.