Change in vdsm[master]: ipwrapperTests: prevent infinite stuck of iterator

phoracek at redhat.com phoracek at redhat.com
Fri Dec 12 09:15:57 UTC 2014


Petr Horáček has uploaded a new change for review.

Change subject: ipwrapperTests: prevent infinite stuck of iterator
......................................................................

ipwrapperTests: prevent infinite stuck of iterator

Sometimes, ipwrapper monitor.start() is not fast enough and it's
returned before it's proper started and listening. In this case, monitor
doesn't catch the first created device and iterator.next() stuck
forever.

I included quick sleep() fix, to prevent this problem until we get new
netlink-based event monitor.

Change-Id: Iec49f21c76a1cd9d02e3fb1f36a4d4e4de7f057e
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M tests/ipwrapperTests.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/36121/1

diff --git a/tests/ipwrapperTests.py b/tests/ipwrapperTests.py
index 62f331c..a9f468a 100644
--- a/tests/ipwrapperTests.py
+++ b/tests/ipwrapperTests.py
@@ -18,6 +18,8 @@
 #
 # Refer to the README and COPYING files for full details of the license
 #
+from time import sleep
+
 from testValidation import ValidateRunningAsRoot
 from vdsm import ipwrapper
 from vdsm.ipwrapper import Monitor
@@ -156,6 +158,7 @@
         tcTests._checkDependencies()
         mon = Monitor()
         mon.start()
+        sleep(0.5)
         iterator = iter(mon)
 
         bridge.addDevice()  # Generate an event to avoid blocking


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec49f21c76a1cd9d02e3fb1f36a4d4e4de7f057e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list