Nir Soffer has uploaded a new change for review.
Change subject: Run pinger in separate process ......................................................................
Run pinger in separate process
Running pinger in a separate process should be less fragile, as the pinger thread cannot be delayed because of locking issues. Hopefully this will eliminate the conectivity failures we see on CI.
Change-Id: I92719ef4a2673ed874fa47a9acbc1e7028bb7197 Signed-off-by: Nir Soffer nsoffer@redhat.com --- A tests/functional/ping.py M tests/functional/utils.py 2 files changed, 14 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/22293/1
diff --git a/tests/functional/ping.py b/tests/functional/ping.py new file mode 100644 index 0000000..70f9195 --- /dev/null +++ b/tests/functional/ping.py @@ -0,0 +1,8 @@ +import time +from vdsm import vdscli + +client = vdscli.connect() + +while True: + client.ping() + time.sleep(1) diff --git a/tests/functional/utils.py b/tests/functional/utils.py index 79327f6..e884a79 100644 --- a/tests/functional/utils.py +++ b/tests/functional/utils.py @@ -19,13 +19,14 @@ from collections import namedtuple from contextlib import contextmanager from functools import wraps -import time -import threading +import os
from vdsm.config import config +from vdsm import constants from vdsm import ipwrapper from vdsm import netinfo from vdsm import vdscli +from vdsm import utils from vdsm.netconfpersistence import RunningConfig import supervdsm
@@ -174,19 +175,12 @@ @contextmanager def pinger(self): """Keeps pinging vdsm for operations that need it""" - def ping(): - while not done: - self.vdscli.ping() - time.sleep(1) + path = os.path.join(os.path.dirname(__file__), 'ping.py') + pinger = utils.execCmd([constants.EXT_PYTHON, path], sync=False) try: - done = False - pinger_thread = threading.Thread(target=ping) - pinger_thread.start() yield - except Exception: - raise finally: - done = True + pinger.kill()
def networkQos(self, networkName): network = self.netinfo.networks[networkName]