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)
--
To view, visit
http://gerrit.ovirt.org/36267
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I62cca38db73a0344d927e58cf79ca14e323278bf
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes