Nir Soffer has posted comments on this change. Change subject: tests: Improve utils.retry tests ......................................................................
Patch Set 1: (2 comments) 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): > This fake is implicitly dependent on patching monotonic_time, it will be ni Yes, this dependency is ugly, but FakeTime does not know anything about utils.monotonic_time, the caller makes this binding. This may be improved by having our own time related module, but it is not in the scope now. Line 63: utils.monotonic_time.now += seconds Line 64: Line 65: Line 66: class RetryTests(TestCaseBase): Line 93: # time action Line 94: # 0 first attempt Line 95: # 1 sleep Line 96: # 2 second attempt Line 97: # 3 bail out (3 == deadline) > I guess this is a matter of interpretation. Sure, I think this interpretation is more useful, specially when dealing with monotonic time, because it may return the same value for 10 milliseconds. Line 98: Line 99: def operation(): Line 100: time.sleep(1) Line 101: raise RuntimeError -- 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 <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Edward Haas <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Piotr Kliczewski <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
