From aaf79d5611f7b66b0315e123dee2c165b80f9fdf Mon Sep 17 00:00:00 2001 From: Eric Fried Date: Sun, 17 Mar 2019 15:03:48 -0500 Subject: [PATCH] Speed up test_report Mock sleep in some tests in the test_report UT module so we don't waste time. Change-Id: Ib540e00d80bc4ad3929a507b7ba03eb84766a53e --- nova/tests/unit/scheduler/client/test_report.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nova/tests/unit/scheduler/client/test_report.py b/nova/tests/unit/scheduler/client/test_report.py index 23bc1307ed48..8d05e19da8eb 100644 --- a/nova/tests/unit/scheduler/client/test_report.py +++ b/nova/tests/unit/scheduler/client/test_report.py @@ -351,6 +351,7 @@ class TestPutAllocations(SchedulerReportClientTestCase): mock.call(expected_url, mock.ANY, version='1.28', global_request_id=self.context.global_id)] * 2) + @mock.patch('time.sleep', new=mock.Mock()) @mock.patch('nova.scheduler.client.report.SchedulerReportClient.put') def test_put_allocations_retry_gives_up(self, mock_put): @@ -987,6 +988,7 @@ class TestPutAllocations(SchedulerReportClientTestCase): self.assertTrue(res) + @mock.patch('time.sleep', new=mock.Mock()) def test_claim_resources_fail_due_to_rp_generation_retry_success(self): get_resp_mock = mock.Mock(status_code=200) get_resp_mock.json.return_value = { @@ -3663,6 +3665,7 @@ class TestAllocations(SchedulerReportClientTestCase): ], mock_put.mock_calls) + @mock.patch('time.sleep', new=mock.Mock()) @mock.patch("nova.scheduler.client.report.SchedulerReportClient.put") @mock.patch("nova.scheduler.client.report.SchedulerReportClient.get") def test_remove_res_from_alloc_run_out_of_retries(