Change in vdsm[master]: tests: increase timeout to 30 seconds

ykaplan at redhat.com ykaplan at redhat.com
Thu Dec 18 10:19:45 UTC 2014


Yeela Kaplan has uploaded a new change for review.

Change subject: tests: increase timeout to 30 seconds
......................................................................

tests: increase timeout to 30 seconds

Increase maximum timeout to 30 seconds instead of only 1.
On automation testing gc is a bit slower,
so we want to be safe and avoid unit tests failing.

Change-Id: I62cca38db73a0344d927e58cf79ca14e323278bf
Signed-off-by: Yeela Kaplan <ykaplan at redhat.com>
---
M tests/outOfProcessTests.py
1 file changed, 14 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/36267/1

diff --git a/tests/outOfProcessTests.py b/tests/outOfProcessTests.py
index 8cb89a7..18c97e9 100644
--- a/tests/outOfProcessTests.py
+++ b/tests/outOfProcessTests.py
@@ -63,6 +63,7 @@
 
     def testAmountOfInstancesPerPoolName(self):
         idle = oop.IOPROC_IDLE_TIME
+        maxSleep = 30
         try:
             oop.IOPROC_IDLE_TIME = 5
             poolA = "A"
@@ -74,16 +75,19 @@
             oop.getProcessPool(poolB)
             self.assertEquals(wrapper(), None)
             gc.collect()
-            time.sleep(1)
-            gc.collect()
-            try:
-                self.assertEquals(ioproc(), None)
-            except AssertionError:
-                logging.info("GARBAGE: %s", gc.garbage)
-                refs = gc.get_referrers(ioproc())
-                logging.info(refs)
-                logging.info(gc.get_referrers(*refs))
-                raise
+            for i in xrange(1, maxSleep+1):
+                time.sleep(1)
+                gc.collect()
+                try:
+                    self.assertEquals(ioproc(), None)
+                    break
+                except AssertionError:
+                    if (i == maxSleep):
+                        logging.info("GARBAGE: %s", gc.garbage)
+                        refs = gc.get_referrers(ioproc())
+                        logging.info(refs)
+                        logging.info(gc.get_referrers(*refs))
+                        raise
         finally:
             oop.IOPROC_IDLE_TIME = idle
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I62cca38db73a0344d927e58cf79ca14e323278bf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>


More information about the vdsm-patches mailing list