Invalid UUIDs during tests

Bug #1606647 reported by Gábor Antal
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Ed Leafe

Bug Description

In many places, wrong fake UUID is used. We should get rid of them. Except nova_manage which uses the markers, and UUIDs the wrong way, so we cannot removed that one (this time).

During testint (e.g.: tox -epy27), lot of warnings get created in the log.
Some examples, which we should remove:

{6} nova.tests.unit.compute.test_compute_mgr.ComputeManagerUnitTestCase.test_check_device_tagging_tagged_net_req_no_virt_support [0.157444s] ... ok

Captured stderr:
~~~~~~~~~~~~~~~~
    /home/user/nova/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_versionedobjects/fields.py:348: FutureWarning: bar is an invalid UUID. Using UUIDFields with invalid UUIDs is no longer supported, and will be removed in a future release. Please update your code to input valid UUIDs or accept ValueErrors for invalid UUIDs. See http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField for further details
      "for further details" % value, FutureWarning)

{0} nova.tests.unit.network.test_neutronv2.TestNeutronv2.test_allocate_for_instance_not_enough_macs [0.135878s] ... ok

Captured stderr:
~~~~~~~~~~~~~~~~
    /home/user/nova/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_versionedobjects/fields.py:348: FutureWarning: fake is an invalid UUID. Using UUIDFields with invalid UUIDs is no longer supported, and will be removed in a future release. Please update your code to input valid UUIDs or accept ValueErrors for invalid UUIDs. See http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField for further details
      "for further details" % value, FutureWarning)

{5} nova.tests.unit.network.test_neutronv2.TestNeutronv2.test_allocate_for_instance_with_externalnet_admin_ctx [0.139779s] ... ok

Captured stderr:
~~~~~~~~~~~~~~~~
    /home/user/nova/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_versionedobjects/fields.py:348: FutureWarning: fake is an invalid UUID. Using UUIDFields with invalid UUIDs is no longer supported, and will be removed in a future release. Please update your code to input valid UUIDs or accept ValueErrors for invalid UUIDs. See http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField for further details
      "for further details" % value, FutureWarning)

But there are some warnings, which we can't remove easily. These are the markers in nova manage.
Some warnings, we cannot remove easily:
nova.tests.unit.test_nova_manage.CellV2CommandsTestCase.test_map_instances_marker_deleted [0.652649s] ... ok

Captured stderr:
~~~~~~~~~~~~~~~~
    /home/user/nova/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_versionedobjects/fields.py:348: FutureWarning: 73e1b0e8 cb2f 460b 926d 547f1f24bfef is an invalid UUID. Using UUIDFields with invalid UUIDs is no longer supported, and will be removed in a future release. Please update your code to input valid UUIDs or accept ValueErrors for invalid UUIDs. See http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField for further details
      "for further details" % value, FutureWarning)

{1} nova.tests.unit.test_nova_manage.CellV2CommandsTestCase.test_map_instances_max_count [0.515909s] ... ok

Captured stderr:
~~~~~~~~~~~~~~~~
    /home/user/nova/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_versionedobjects/fields.py:348: FutureWarning: ca009c24 21b8 471c 8ca7 1cc0981d97e5 is an invalid UUID. Using UUIDFields with invalid UUIDs is no longer supported, and will be removed in a future release. Please update your code to input valid UUIDs or accept ValueErrors for invalid UUIDs. See http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField for further details
      "for further details" % value, FutureWarning)

Changed in nova:
assignee: nobody → Gábor Antal (gabor.antal)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/347748

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 6c8d882e8c8bac14d6ee2f20c0235a5ea7633cb8
Author: Gábor Antal <email address hidden>
Date: Wed Jul 27 12:10:50 2016 +0200

    Fixed invalid UUIDs in unit tests

    Many places in tests, wrong fake UUID is used, which
    pollutes the test log with the deprecation warnings.
    In this patchset, I fixed them in the unit tests.

    Change-Id: Ifd6a8bfa05a84d1d540e4382e9561c590b731044
    Partial-Bug: #1606647

Revision history for this message
Steve Noyes (steve-noyes) wrote :

another case in fake_block_device_db:

class FakeDbBlockDeviceDict(block_device.BlockDeviceDict):
    """Defaults db fields - useful for mocking database calls."""

    def __init__(self, bdm_dict=None, anon=False, **kwargs):
        bdm_dict = bdm_dict or {}
        db_id = bdm_dict.pop('id', 1) <<<<<<<<<

Revision history for this message
Steve Noyes (steve-noyes) wrote :

Please ignore the above, that was not the problem.

Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing
the status back to the previous state and unassigning. If
there are active reviews related to this bug, please include
links in comments.

Changed in nova:
status: In Progress → New
assignee: Gábor Antal (gabor.antal) → nobody
Sean Dague (sdague)
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Ed Leafe (ed-leafe)
Changed in nova:
assignee: nobody → Ed Leafe (ed-leafe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/531479

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/539247

Changed in nova:
assignee: Ed Leafe (ed-leafe) → Stephen Finucane (stephenfinucane)
assignee: Stephen Finucane (stephenfinucane) → Ed Leafe (ed-leafe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/539254

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.openstack.org/539247
Reason: Let's go with https://review.openstack.org/#/c/539254/, which is both older and more complete

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

Reviewed: https://review.openstack.org/539254
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1278f2dc11e83618dc9932b7fe80d6b84517ccdd
Submitter: Zuul
Branch: master

commit 1278f2dc11e83618dc9932b7fe80d6b84517ccdd
Author: Ed Leafe <email address hidden>
Date: Thu Jan 11 17:58:15 2018 +0000

    Fix invalid UUIDs in remaining tests

    There were many places throughout our tests that used plain strings
    where the object was expecting a UUID, which caused lots of warning
    output when running the tests. This patch replaces all such usages with
    proper UUIDs.

    Closes-Bug: #1606647

    Change-Id: Ib339b97ef178c870405e19385d3df24dd1f730cc

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

Reviewed: https://review.openstack.org/531479
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=24b23954035a5a1bde03c2dd968ec930afe1a55a
Submitter: Zuul
Branch: master

commit 24b23954035a5a1bde03c2dd968ec930afe1a55a
Author: Ed Leafe <email address hidden>
Date: Fri Jan 5 19:10:43 2018 +0000

    Fix invalid UUIDs in test_compute.py

    There were many places in test_compute.py that used plain strings where
    the object was expecting a UUID, which caused lots of warning output
    when running the tests. This patch replaces all such usages with proper
    UUIDs.

    Partial-Bug: #1606647

    Change-Id: Ie3c4b3eea25f0f50d301b3a529ab836e7f789104

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0rc1

This issue was fixed in the openstack/nova 17.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/550238

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Russell Tweed (<email address hidden>) on branch: master
Review: https://review.openstack.org/550238

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.