Change in vdsm[master]: tests: Improve utils.retry tests

nsoffer at redhat.com nsoffer at redhat.com
Sun Sep 27 13:32:32 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: tests: Improve utils.retry tests
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

Needs more obvious monkeypatching.

https://gerrit.ovirt.org/#/c/46399/1//COMMIT_MSG
Commit Message:

Line 11: This patch adds 4 tests, revealing issues in the current code:
Line 12: 
Line 13: - Test that we bail out when the deadline is reached (broken).
Line 14: - Test the special case when running the operation did not time out, but
Line 15:   we don't have time for sleep (broken).
> suggested rephrase: test that we do not wait needlessly if the a sleep woul
Thanks, will fix
Line 16: - Test the special case when deadline has passed when the operation was
Line 17:   finished (ok).
Line 18: - Test the special case of zero timeout (ok).
Line 19: 


https://gerrit.ovirt.org/#/c/46399/1/tests/utilsTests.py
File tests/utilsTests.py:

Line 58:     def __call__(self):
Line 59:         return self.now
Line 60: 
Line 61: 
Line 62: def fake_sleep(seconds):
> How about placing fake_sleep as a FakeTime method? FakeTime can then be ins
Ok, I will improve this in the next version.
Line 63:     utils.monotonic_time.now += seconds
Line 64: 
Line 65: 
Line 66: class RetryTests(TestCaseBase):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I62062f36e20d263b1aed64135345d496cb7cfd61
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh.dev at gmail.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list