Dan Kenigsberg has submitted this change and it was merged. Change subject: tests: clear libvirtconnection cache ......................................................................
tests: clear libvirtconnection cache the libvirtconnection has a cache to reuse connections, and this caching doesn't play well with the monkeypatching which we do in tests. In libvirtconnectionTests, we create fake libvirt objects, most notably fake virConnect-s. Unfortunately, the test fails to clean up properly the libvirtconnection cache. So, the test runs just fine in isolation, but if run in batch like in 'make check', later tests which expect the real object become broken. The failure presents itself like the following: AttributeError: 'virConnect' object has no attribute 'getMemoryStats' This patch fixes this error adding a facility to clear the libvirtconnection cache, and clearing it after each test. Change-Id: If4d64920e5f26c276accf26b7a532461d04f02df Signed-off-by: Francesco Romani <[email protected]> Reviewed-on: http://gerrit.ovirt.org/37747 Reviewed-by: Nir Soffer <[email protected]> Reviewed-by: Dan Kenigsberg <[email protected]> --- M lib/vdsm/libvirtconnection.py M tests/libvirtconnectionTests.py 2 files changed, 12 insertions(+), 0 deletions(-) Approvals: Nir Soffer: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified -- To view, visit http://gerrit.ovirt.org/37747 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If4d64920e5f26c276accf26b7a532461d04f02df Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Ala Hino <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: [email protected] _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
