Skip to content

Commit

Permalink
Fix flaky ExtensionCleanupTest class (#1898)
Browse files Browse the repository at this point in the history
  • Loading branch information
larohra authored May 29, 2020
1 parent e48c207 commit fcbe81b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/ga/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class TestExtensionCleanup(AgentTestCase):

def setUp(self):
AgentTestCase.setUp(self)
self.mock_sleep = patch("time.sleep", lambda *_: mock_sleep(0.0001))
self.mock_sleep = patch("time.sleep", lambda *_: mock_sleep(0.01))
self.mock_sleep.start()

def tearDown(self):
Expand All @@ -110,10 +110,12 @@ def _is_extension_dir(path):
def _assert_ext_handler_status(self, aggregate_status, expected_status, version, expected_ext_handler_count=0):
self.assertIsNotNone(aggregate_status, "Aggregate status should not be None")
handler_statuses = aggregate_status['aggregateStatus']['handlerAggregateStatus']
self.assertEqual(expected_ext_handler_count, len(handler_statuses))
self.assertEqual(expected_ext_handler_count, len(handler_statuses),
"All ExtensionHandlers: {0}".format(handler_statuses))
for ext_handler_status in handler_statuses:
self.assertEquals(expected_status, ext_handler_status['status'])
self.assertEquals(version, ext_handler_status['handlerVersion'])
debug_info = "ExtensionHandler: {0}".format(ext_handler_status)
self.assertEquals(expected_status, ext_handler_status['status'], debug_info)
self.assertEquals(version, ext_handler_status['handlerVersion'], debug_info)
return

@contextlib.contextmanager
Expand Down

0 comments on commit fcbe81b

Please sign in to comment.