Random unit test inputs are not random across test runs
Bug #1639755 reported by
Alistair Coles
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Unit tests use the random module in places to randomise test inputs, but once the tests in test_builder.py or test_ring_
I proposed a fix [1] to reset the seed value, but it revealed some intermittently failing tests in test_builder.py - I suspect those tests are relying on non-random input :/ If someone wants to figure that out then please add to my patch.
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/371564 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=7fa9d6e5b4f b74ad95f059742d 8844e7c12fa235
Committed: https:/
Submitter: Jenkins
Branch: master
commit 7fa9d6e5b4fb74a d95f059742d8844 e7c12fa235
Author: Alistair Coles <email address hidden>
Date: Fri Sep 16 14:31:44 2016 +0100
Unset random seed after rebalancing ring
Unit tests use the random module in places to randomise ring_builder_ analyzer. py have been run the random
test inputs, but once the tests in test_builder.py or
test_
seed is left in a repeatable state because calls are made
to RingBuilder.balance with a seed value. Consequently,
subsequent calls to random in other tests get repeatable
results from one test run to another.
This patch resets the state of the random module before rebalance.
returning from RingBuilder.
Closes-Bug: #1639755 60452e65b3e0f1b 45a189c16e3
Change-Id: I4b74030afc654e