tests.unit.quota.test_resource can randomly fail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Low
|
Al Miller |
Bug Description
The TestTrackedResource class is designed to inject random failures into the gate. It generates random numbers within the range of 0..10000, and will fail if it generates duplicate random numbers during its run.
class TestTrackedReso
def _add_data(self, tenant_id=None):
session = db_api.
with session.begin():
Because the test repeatedly calls _add_data(), if the calls to randint() ever generate the same number during a test, it will fail. Aggregated over hundreds, or sometimes thousands, of test runs per day, I would estimate that this could cause several unnecessary check/gate failures in a busy day.
I propose changing random.randint() to uuid.uuid4(), which gives us a much larger random number space and a much smaller probability of collision.
Changed in neutron: | |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | liberty-rc1 → 7.0.0 |
Fix proposed to branch: master /review. openstack. org/221976
Review: https:/