Merge pull request #29385 from kamoltat/wip-qa-tasks-mgr-test-progress-bug-fix

qa/tasks/mgr/test_progress.py: fix bug in 9b4dbf0

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Kefu Chai 2019-08-09 12:18:40 +08:00 committed by GitHub
commit 3efc51fa1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -127,7 +127,7 @@ class TestProgress(MgrTestCase):
self.wait_until_equal(lambda: len(self._events_in_progress()), 1,
timeout=self.EVENT_CREATION_PERIOD)
new_event = self._all_events()[0]
new_event = self._events_in_progress()[0]
log.info(json.dumps(new_event, indent=1))
self.assertIn("Rebalancing after osd.0 marked in", new_event['message'])

View File

@ -433,7 +433,8 @@ class Module(MgrModule):
# In the case of the osd coming back in, we might need to cancel
# previous recovery event for that osd
if marked == "in":
for ev_id, ev in self._events.items():
for ev_id in list(self._events):
ev = self.events[ev_id]
if isinstance(ev, PgRecoveryEvent) and osd_id in ev.which_osds:
self.log.info("osd.{0} came back in, cancelling event".format(
osd_id
@ -486,7 +487,8 @@ class Module(MgrModule):
self._osdmap_changed(old_osdmap, self._latest_osdmap)
elif notify_type == "pg_summary":
data = self.get("pg_dump")
for ev_id, ev in self._events.items():
for ev_id in list(self._events):
ev = self._events[ev_id]
if isinstance(ev, PgRecoveryEvent):
ev.pg_update(data, self.log)
self.maybe_complete(ev)