diff options
author | Victor Sergeyev <vsergeyev@mirantis.com> | 2015-05-29 14:57:14 +0300 |
---|---|---|
committer | Victor Sergeyev <vsergeyev@mirantis.com> | 2015-05-29 15:00:48 +0300 |
commit | fa2a501c52c7f077ec84d8884bcdd486dce830aa (patch) | |
tree | 16549e037b3201192c9ffb592316fc7065b3fd66 | |
parent | baddce34a2f94487f162014df7423a63d58fcd18 (diff) | |
download | oslo-messaging-fa2a501c52c7f077ec84d8884bcdd486dce830aa.tar.gz |
Set places to 0 in self.assertAlmostEqual()
We are checking time of thread run in test_impl_rabbit.py and sometimes
it can be a bit longer, because of server load.
Set places=0 instead of 1 to make tests less restrictive.
Change-Id: I2ef6f1474047e1da64402e93696cb73b4d3318e8
-rw-r--r-- | oslo_messaging/tests/drivers/test_impl_rabbit.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py index 1e942a9..9a9a747 100644 --- a/oslo_messaging/tests/drivers/test_impl_rabbit.py +++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py @@ -938,15 +938,15 @@ class ConnectionLockTestCase(test_utils.BaseTestCase): l = rabbit_driver.ConnectionLock() t1 = self._thread(l, 1) t2 = self._thread(l, 1) - self.assertAlmostEqual(1, t1(), places=1) - self.assertAlmostEqual(2, t2(), places=1) + self.assertAlmostEqual(1, t1(), places=0) + self.assertAlmostEqual(2, t2(), places=0) def test_worker_and_heartbeat(self): l = rabbit_driver.ConnectionLock() t1 = self._thread(l, 1) t2 = self._thread(l, 1, heartbeat=True) - self.assertAlmostEqual(1, t1(), places=1) - self.assertAlmostEqual(2, t2(), places=1) + self.assertAlmostEqual(1, t1(), places=0) + self.assertAlmostEqual(2, t2(), places=0) def test_workers_and_heartbeat(self): l = rabbit_driver.ConnectionLock() @@ -955,15 +955,15 @@ class ConnectionLockTestCase(test_utils.BaseTestCase): t3 = self._thread(l, 1) t4 = self._thread(l, 1, heartbeat=True) t5 = self._thread(l, 1) - self.assertAlmostEqual(1, t1(), places=1) - self.assertAlmostEqual(2, t4(), places=1) - self.assertAlmostEqual(3, t2(), places=1) - self.assertAlmostEqual(4, t3(), places=1) - self.assertAlmostEqual(5, t5(), places=1) + self.assertAlmostEqual(1, t1(), places=0) + self.assertAlmostEqual(2, t4(), places=0) + self.assertAlmostEqual(3, t2(), places=0) + self.assertAlmostEqual(4, t3(), places=0) + self.assertAlmostEqual(5, t5(), places=0) def test_heartbeat(self): l = rabbit_driver.ConnectionLock() t1 = self._thread(l, 1, heartbeat=True) t2 = self._thread(l, 1) - self.assertAlmostEqual(1, t1(), places=1) - self.assertAlmostEqual(2, t2(), places=1) + self.assertAlmostEqual(1, t1(), places=0) + self.assertAlmostEqual(2, t2(), places=0) |