Francesco Romani has uploaded a new change for review.
Change subject: tests: improve periodicTests.py ......................................................................
tests: improve periodicTests.py
document a bit better the code and make it easier to understand the test failures.
Change-Id: I75b890daed01d23cfa0a36db66615a48023b96c0 Signed-off-by: Francesco Romani fromani@redhat.com --- M tests/periodicTests.py 1 file changed, 18 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/65753/1
diff --git a/tests/periodicTests.py b/tests/periodicTests.py index 4cc2b21..4df36d6 100644 --- a/tests/periodicTests.py +++ b/tests/periodicTests.py @@ -219,6 +219,9 @@
@permutations(VM_IDS) def test_dispatch(self, failed_ids): + """ + check that we dispatch even if for any reason required() raises. + """ for i in failed_ids: with self.cif.vmContainerLock: vm_id = _fake_vm_id(i) @@ -257,16 +260,17 @@ # we don't care about executor (hence the simplistic fake) op()
+ for vm_id in skip_ids: + self.assertNotIn(_fake_vm_id(vm_id), _Visitor.VMS) + vms = self.cif.getVMs() + expected = ( set(vms.keys()) - set(_fake_vm_id(i) for i in skip_ids) ) for vm_id in expected: self.assertEqual(_Visitor.VMS.get(vm_id), 1) - - for vm_id in skip_ids: - self.assertEqual(_Visitor.VMS.get(vm_id), None)
def _make_fake_vms(self): for i in range(VM_NUM): @@ -391,3 +395,14 @@
def updateNumaInfo(self): pass + + def __repr__(self): + return ( + "<VM=%s name=%s migrating=%s " + "monitorable=%s ready=%s " + "fail_required=%s fail_runnable=%s>" % ( + self.id, self.name, self.migrating, + self.monitorable, self.ready, + getattr(self, 'fail_required', False), + getattr(self, 'fail_runnable', False)) + )
gerrit-hooks has posted comments on this change.
Change subject: tests: improve periodicTests.py ......................................................................
Patch Set 1:
* Update Tracker::IGNORE, no bug url/s found * Check Bug-Url::IGNORE, no bug url/s found * Check Public Bug::WARN, no public bug url found * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Francesco Romani has posted comments on this change.
Change subject: tests: improve periodicTests.py ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/65753/1/tests/periodicTests.py File tests/periodicTests.py:
PS1, Line 263: for vm_id in skip_ids: : self.assertNotIn(_fake_vm_id(vm_id), _Visitor.VMS) this needs to be in 65590
vdsm-patches@lists.fedorahosted.org