Skip to content

Commit

Permalink
Merge pull request #39397 from kamoltat/wip-nautilus-del-period-arg
Browse files Browse the repository at this point in the history
nautilus: qa/tasks/mgr/test_progress: fix wait_until_equal

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
  • Loading branch information
yuriw committed Apr 12, 2021
2 parents 57df519 + cb6a384 commit 21b8fb7
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions qa/tasks/mgr/test_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ def _simulate_failure(self, osd_ids=None):

# Wait for a progress event to pop up
self.wait_until_equal(lambda: self._osd_in_out_events_count('out'), 1,
timeout=self.EVENT_CREATION_PERIOD*2,
period=1)
timeout=self.EVENT_CREATION_PERIOD*2)
ev = self._get_osd_in_out_events('out')[0]
log.info(json.dumps(ev, indent=1))
self.assertIn("Rebalancing after osd.0 marked out", ev['message'])
Expand All @@ -182,13 +181,12 @@ def _simulate_back_in(self, osd_ids, initial_event):

# First Event should complete promptly
self.wait_until_true(lambda: self._is_complete(initial_event['id']),
timeout=self.EVENT_CREATION_PERIOD)
timeout=self.RECOVERY_PERIOD)

try:
# Wait for progress event marked in to pop up
self.wait_until_equal(lambda: self._osd_in_out_events_count('in'), 1,
timeout=self.EVENT_CREATION_PERIOD*2,
period=1)
timeout=self.EVENT_CREATION_PERIOD*2)
except RuntimeError as ex:
if not "Timed out after" in str(ex):
raise ex
Expand Down Expand Up @@ -261,7 +259,7 @@ def test_pool_removal(self):

# Event should complete promptly
self.wait_until_true(lambda: self._is_complete(ev['id']),
timeout=self.EVENT_CREATION_PERIOD)
timeout=self.RECOVERY_PERIOD)
self.assertTrue(self._is_quiet())

def test_osd_came_back(self):
Expand All @@ -274,10 +272,11 @@ def test_osd_came_back(self):
ev1 = self._simulate_failure()

ev2 = self._simulate_back_in([0], ev1)

# Wait for progress event to ultimately complete
self.wait_until_true(lambda: self._is_complete(ev2['id']),
timeout=self.RECOVERY_PERIOD)

if ev2 is not None:
# Wait for progress event to ultimately complete
self.wait_until_true(lambda: self._is_complete(ev2['id']),
timeout=self.RECOVERY_PERIOD)

self.assertTrue(self._is_quiet())

Expand Down Expand Up @@ -364,8 +363,8 @@ def test_turn_off_module(self):
'osd', 'out', '0')

# Wait for a progress event to pop up
self.wait_until_equal(lambda: len(self._all_events()), 1,
timeout=self.EVENT_CREATION_PERIOD*2)
self.wait_until_equal(lambda: self._osd_in_out_events_count('out'), 1,
timeout=self.RECOVERY_PERIOD)

ev = self._all_events()[0]

Expand Down

0 comments on commit 21b8fb7

Please sign in to comment.