Nir Soffer has posted comments on this change.
Change subject: tests: Add tests for poll and wait failures ......................................................................
Patch Set 8:
(2 comments)
https://gerrit.ovirt.org/#/c/65294/8/tests/utilsTests.py File tests/utilsTests.py:
Line 132: self.check_failure() Line 133: Line 134: def test_kill_failure(self): Line 135: def fail(): Line 136: raise ExpectedFailure("Fake kill failure")
Now we have it 3 times.
3 test, 3 fail texts, please suggest a simple and more clear code. Line 137: Line 138: self.proc.kill = fail Line 139: self.check_failure() Line 140:
Line 154: self.assertEqual(type(e.exception.error), ExpectedFailure) Line 155: Line 156: # Note: We cannot check return code since AsyncProc.returncode is a Line 157: # property calling poll(). The return code here may be None or -9, Line 158: # depeending on timing.
Wouldn't be better to wait to be sure that timing is correct instead of rem
There is no way to test this with AsyncProc, check how it imlements returncode. Line 159: Line 160: Line 161: class ExpectedFailure(Exception): Line 162: pass
vdsm-patches@lists.fedorahosted.org