Use of randint in functional tests is racey

Bug #1860417 reported by Stephen Finucane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Stephen Finucane

Bug Description

In change I475ea0fa5f2d5b197118f0ced5a0ff6907411972, we switched to using 'random.randint' to generate flavor.id values in functional tests. This has proven racey, as seen at [1].

[1] https://zuul.opendev.org/t/openstack/build/c308dab9bd2d43d0b40cf999a34af0f7/console

Tags: testing
tags: added: testing
Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/703568

Changed in nova:
assignee: nobody → Stephen Finucane (stephenfinucane)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/703568
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=765e4e52bffa66922808e8a4ca3c75a145049500
Submitter: Zuul
Branch: master

commit 765e4e52bffa66922808e8a4ca3c75a145049500
Author: Stephen Finucane <email address hidden>
Date: Tue Jan 21 09:44:14 2020 +0000

    functional: Stop setting Flavor.id

    In change I475ea0fa5f2d5b197118f0ced5a0ff6907411972, we changed how we
    generated flavor names and IDs to stop basing them on existing flavors.
    However, the call to 'randint(10000)' that we used instead has proven
    problematic since there is a high chance of collisions that will only
    increase as the number of tests increase. We could switch back to the
    previous scheme but that's unnecessary since there's actually no reason
    we need to set 'Flavor.id' in the first place...so don't.

    A now-unused remnant of the "old way" is also removed, since it was
    spotted while fixing this.

    Change-Id: Iab6245bc5ed8f95dae9c384b96e6bef0add7dca6
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-bug: #1860417

Changed in nova:
status: In Progress → Fix Released
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.