From e40d94c69d6ec2250c5ab2e79e7c0d60fae4e91c Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Mon, 17 Dec 2018 19:15:05 +0200 Subject: [PATCH] Remove time checks from test_custom_execute_timeout_* tests Time checks were introduced in I058ff0a0e5ad517507dc3cda39087c913558561d and adjusted in I3c2874855c2f061e93ecd088c516696366350833 commits. They are still unstable on same environments. Let's disable these checks until we'll have a better solution with a propper mocking. Change-Id: Ia9054d7516909f68b89b647b743ca1d3ddef954e --- os_brick/tests/privileged/test_rootwrap.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/os_brick/tests/privileged/test_rootwrap.py b/os_brick/tests/privileged/test_rootwrap.py index 2d94a5a2e..dbe6928ae 100644 --- a/os_brick/tests/privileged/test_rootwrap.py +++ b/os_brick/tests/privileged/test_rootwrap.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -import time - import mock from oslo_concurrency import processutils as putils import six @@ -91,14 +89,11 @@ class PrivRootwrapTestCase(base.TestCase): def test_custom_execute_timeout_raises_with_retries(self, sleep_mock): on_execute = mock.Mock() on_completion = mock.Mock() - t0 = time.time() self.assertRaises(exception.ExecutionTimeout, priv_rootwrap.custom_execute, 'sleep', '2', timeout=0.05, raise_timeout=True, interval=2, backoff_rate=3, attempts=3, on_execute=on_execute, on_completion=on_completion) - t1 = time.time() - self.assertLess(t1 - t0, 0.6) sleep_mock.assert_has_calls([mock.call(0), mock.call(6), mock.call(0), mock.call(18), mock.call(0)]) expected_calls = [mock.call(args[0][0]) @@ -107,13 +102,10 @@ class PrivRootwrapTestCase(base.TestCase): on_completion.assert_has_calls(expected_calls) def test_custom_execute_timeout_no_raise(self): - t0 = time.time() out, err = priv_rootwrap.custom_execute('sleep', '2', timeout=0.05, raise_timeout=False) - t1 = time.time() self.assertEqual('', out) self.assertIsInstance(err, six.string_types) - self.assertLess(t1 - t0, 0.3) def test_custom_execute_check_exit_code(self): self.assertRaises(putils.ProcessExecutionError,