Change in vdsm[master]: tests: virt: retry to connect to VDSM at startup

fromani at redhat.com fromani at redhat.com
Thu Apr 10 07:13:39 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: tests: virt: retry to connect to VDSM at startup
......................................................................

tests: virt: retry to connect to VDSM at startup

This patch makes the functional tests retry to connect
to the VDSM instance before to give up and raise an error.

The purpose is let tests to actively wait for VDSM
instance to be up instead of blindly wait some time and
hope for the best.

This will help us to drop the 10s sleep we currently
have in our virt functional tests job.

Change-Id: Ic3a6e9e484d7bf0c506b804131b9e958deff5692
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M tests/functional/utils.py
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/26638/1

diff --git a/tests/functional/utils.py b/tests/functional/utils.py
index 5cbb84f..d4b34e1 100644
--- a/tests/functional/utils.py
+++ b/tests/functional/utils.py
@@ -19,10 +19,12 @@
 from collections import namedtuple
 from contextlib import contextmanager
 from functools import wraps
+import socket
 import time
 import threading
 
 from vdsm.config import config
+from vdsm.utils import retry
 from vdsm import ipwrapper
 from vdsm import netinfo
 from vdsm import vdscli
@@ -67,6 +69,9 @@
     """
 
     def __init__(self):
+        retry(self.start, socket.error, tries=10)
+
+    def start(self):
         self.vdscli = vdscli.connect()
         self.netinfo = \
             netinfo.NetInfo(self.vdscli.getVdsCapabilities()['info'])


-- 
To view, visit http://gerrit.ovirt.org/26638
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3a6e9e484d7bf0c506b804131b9e958deff5692
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list