The test_coordination.py unit module tests a _reconnect() method
which does a randomly seeded exponential retry backoff. This
retry/backoff mechanism introduces needless delay in unit test
runs.
This commit mocks out random.uniform, improving run time by about
a factor of nine, as documented in the accompanying bug.
Closes-Bug: #
1536750
Change-Id: I83fafba17be99cbe972dfb60fe87dac6dc3756cf
@mock.patch('eventlet.tpool.execute', lambda f: f())
@mock.patch.object(coordination.Coordinator, 'heartbeat')
@mock.patch('tooz.coordination.get_coordinator')
+@mock.patch('random.uniform', lambda _a, _b: 0)
class CoordinatorTestCase(test.TestCase):
def test_coordinator_start(self, get_coordinator, heartbeat):
crd = get_coordinator.return_value