placement functional tests can collide when synchronising the traits table

Bug #1759863 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Chris Dent

Bug Description

The placement functional tests make use of the traits table. At the start of most requests to the objects in resource_provider.py some code is run to make sure that traits in the os-traits library are synchronised to the table.

A global flag is present which says "I've already synchronised". Functional tests are responsible for making sure this is in the right state.

It turns out that this management was not complete, and after a recent move of db/test_resource_provider.py and db/test_allocation_candidates.py within the placement hierarchy the delicate balance of how tests are split among processes by stestr was upset. This leads to test failures where no traits are in the traits table.

The fix is to ensure that functional tests manage the related db flags both during setup and teardown and not rely solely on one or the other (as people can easily get it wrong).

Revision history for this message
Matt Riedemann (mriedem) wrote :
tags: added: testing
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/557722

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

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

commit bdf06d18aa4ad81e43bf0d1a22c851b43c4cd1c5
Author: Chris Dent <email address hidden>
Date: Thu Mar 29 15:10:19 2018 +0100

    [placement] Fix bad management of _TRAITS_SYNCED flag

    Placement functional tests could, depending on run order, be unable
    to synchronise the os-traits because a previous test or this test
    has failed to reset the _TRAITS_SYNCED flag.

    This change fixes it so the tests will always reset the flag at
    both setUp and tearDown.

    In the process a nearby misleading comment which says a database is
    not being used is corrected.

    Change-Id: I595be7bca2c1bde86651b126ce501286b301d272
    Closes-Bug: #1759863

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

This issue was fixed in the openstack/nova 18.0.0.0b1 development milestone.

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.