ValueError: URI was None, but fake libvirt is configured to not accept this.

Bug #1258553 reported by Michael Kerrin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Committed
Undecided
Unassigned

Bug Description

There is a race in the unit tests where if nova.tests.virt.libvirt.test_fakelibvirt.FakeLibvirtTests.test_openAuth_can_refuse_None_uri runs before the following test, we get the following error

======================================================================
FAIL: nova.tests.virt.libvirt.test_libvirt.LibvirtNonblockingTestCase.test_tpool_execute_calls_libvirt
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/tmp/buildd/nova-2014.1.dev40.g164d0b0/nova/tests/virt/libvirt/test_libvirt.py", line 7412, in test_tpool_execute_calls_libvirt
    conn = libvirt.virConnect()
  File "/tmp/buildd/nova-2014.1.dev40.g164d0b0/nova/tests/virt/libvirt/fakelibvirt.py", line 527, in __init__
    raise ValueError("URI was None, but fake libvirt is "
ValueError: URI was None, but fake libvirt is configured to not accept this.

Revision history for this message
Matt Riedemann (mriedem) wrote :

Phil Day already has a patch out for fixing this, duplicate of bug 1258603.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/60709
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f95e0858adb18cee5028873990887c81a87a9c7c
Submitter: Jenkins
Branch: master

commit f95e0858adb18cee5028873990887c81a87a9c7c
Author: Chris Yeoh <email address hidden>
Date: Sun Dec 8 23:57:39 2013 +1030

    Get test_openAuth_can_refuse_None_uri to cleanup after itself

    test_openAuth_can_refuse_None_uri sets the global
    libvirt.allow_default_uri_connection to False but it leaves
    it in this state which could cause test_tpool_execute_calls_libvirt
    to fail if it ran immediately afterwards. This patch adds a cleanup
    so _reset is called at the end of the test and not just if
    another test in the same class is run after it.

    Change-Id: I9762fcb81b2318beeb056c67bd9172056e1449ab
    Closes-Bug: 1258553

Changed in nova:
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/60539
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3d8e5884ec6dfbac809263dfa240f5769b70dfa9
Submitter: Jenkins
Branch: master

commit 3d8e5884ec6dfbac809263dfa240f5769b70dfa9
Author: Michael Kerrin <email address hidden>
Date: Fri Dec 6 15:26:17 2013 +0000

    Fix race in unit tests, which can cause gate job to fail

    The FakeLibvirtTests.test_openAuth_can_refuse_None_uri test changes the value
    of the global variable allow_default_uri_connection. We need to clean up this
    change up after running this test so as we don't effect other tests that
    expect the value of this variable to be the default.

    In particular this test was running before the
    LibvirtNonblockingTestCase.test_tpool_execute_calls_libvirt which ran when
    the value was changed causing this test to fail. This only occurred when we
    the test_libvirt used the fake libvirt driver, which happens when the tests
    run inside a virtualenv environment.

    Change-Id: I68c30dffd05daae6c0d5fbc6ec005c0fab4f09be
    Closes-Bug: 1258553

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.