Change in vdsm[master]: tests: Fix too delicate timings

nsoffer at redhat.com nsoffer at redhat.com
Sun Oct 18 22:19:45 UTC 2015


Nir Soffer has uploaded a new change for review.

Change subject: tests: Fix too delicate timings
......................................................................

tests: Fix too delicate timings

Executor slow tests were using racy timings which caused random
failures. Adjust the timing to give 0.1 threads 0.1 second to finish.

We should replace the timeouts with events to make the tests
faster and less fragile.

Change-Id: Ib8890bffcaffafacaa6ec4a3e516a19793096f2d
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M tests/executorTests.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/47442/1

diff --git a/tests/executorTests.py b/tests/executorTests.py
index e2d093e..4b3f947 100644
--- a/tests/executorTests.py
+++ b/tests/executorTests.py
@@ -98,7 +98,9 @@
         slow_tasks = [Task(wait=0.4) for n in range(5)]
         for task in slow_tasks:
             self.executor.dispatch(task, 1.0)
-        # Slow tasks block half of the workers
+        time.sleep(0.1)
+        # Slow tasks block 5 of the workers, so these tasks should finished
+        # after (20 * 0.1) / 5 seconds.
         tasks = [Task(wait=0.1) for n in range(20)]
         for task in tasks:
             self.executor.dispatch(task, 1.0)
@@ -110,7 +112,7 @@
 
     @slowtest
     def test_discarded_workers(self):
-        slow_tasks = [Task(wait=0.4) for n in range(10)]
+        slow_tasks = [Task(wait=0.3) for n in range(10)]
         for task in slow_tasks:
             self.executor.dispatch(task, 0.1)
         # All workers are blocked on slow tasks


-- 
To view, visit https://gerrit.ovirt.org/47442
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8890bffcaffafacaa6ec4a3e516a19793096f2d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list