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@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
Yeela Kaplan has posted comments on this change.
Change subject: tests: increase timeout to 30 seconds ......................................................................
Patch Set 1: Verified+1
oVirt Jenkins CI Server has posted comments on this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Patch Set 1:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/13580/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/14537/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/14369/ : SUCCESS
Dan Kenigsberg has posted comments on this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Patch Set 2:
(4 comments)
http://gerrit.ovirt.org/#/c/36267/2//COMMIT_MSG Commit Message:
Line 7: oop tests: increase timeout to 30 seconds Line 8: Line 9: Increase maximum timeout to 30 seconds instead of only 1. Line 10: On automation testing gc is a bit slower, Line 11: so we want to be safe and avoid unit tests failing. is it really time, or the repeated gc.collect() calls? it's not clear from the test. Line 12: Line 13: Change-Id: I62cca38db73a0344d927e58cf79ca14e323278bf
http://gerrit.ovirt.org/#/c/36267/2/tests/outOfProcessTests.py File tests/outOfProcessTests.py:
Line 61: Line 62: self.assertNotEquals(pids[0], pids[1]) Line 63: Line 64: def testAmountOfInstancesPerPoolName(self): Line 65: idle = oop.IOPROC_IDLE_TIME on another patch: we have `with MonkeyPatch` for these tricks. Line 66: maxSleep = 30 Line 67: try: Line 68: oop.IOPROC_IDLE_TIME = 5 Line 69: poolA = "A"
Line 62: self.assertNotEquals(pids[0], pids[1]) Line 63: Line 64: def testAmountOfInstancesPerPoolName(self): Line 65: idle = oop.IOPROC_IDLE_TIME Line 66: maxSleep = 30 naming this MAXSLEEP makes it clearer that it's a constant. Line 67: try: Line 68: oop.IOPROC_IDLE_TIME = 5 Line 69: poolA = "A" Line 70: poolB = "B"
Line 74: time.sleep(oop.IOPROC_IDLE_TIME + 1) Line 75: oop.getProcessPool(poolB) Line 76: self.assertEquals(wrapper(), None) Line 77: gc.collect() Line 78: for i in xrange(1, maxSleep+1): it seems that you are re-inventing utils.retry().
It would be more elegant if you use retry(gc.collect+assertEqual, AssertionError, MAXSLEEP) Line 79: time.sleep(1) Line 80: gc.collect() Line 81: try: Line 82: self.assertEquals(ioproc(), None)
oVirt Jenkins CI Server has posted comments on this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Patch Set 2:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/13581/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/14538/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/14370/ : SUCCESS
Dan Kenigsberg has posted comments on this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Patch Set 2: Code-Review-1
oVirt Jenkins CI Server has posted comments on this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Patch Set 3:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/13654/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/14611/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/14443/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Patch Set 4:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/13721/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/14678/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/14510/ : SUCCESS
Jenkins CI RO has posted comments on this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Patch Set 4:
Abandoned due to no activity - please restore if still relevant
Jenkins CI RO has abandoned this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
automation@ovirt.org has posted comments on this change.
Change subject: oop tests: increase timeout to 30 seconds ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found
vdsm-patches@lists.fedorahosted.org