From: John Spray Date: Mon, 23 Feb 2015 13:43:13 +0000 (+0000) Subject: tasks: fix intermittent failure in TestFlush X-Git-Tag: v10.2.6~165^2^2~532^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d20d9238cd59bca002d682cbcdc444e15e856de1;p=ceph.git tasks: fix intermittent failure in TestFlush This was an overly strict success condition: the flush operation doesn't promise to leave you an empty journal, it promises that anything in the journal before the flush will be flushed. Fixes: #10712 Signed-off-by: John Spray --- diff --git a/tasks/mds_flush.py b/tasks/mds_flush.py index 6035cd4de85..458de83aefa 100644 --- a/tasks/mds_flush.py +++ b/tasks/mds_flush.py @@ -44,14 +44,42 @@ class TestFlush(CephFSTestCase): # ...and the journal is truncated to just a single subtreemap from the # newly created segment - self.assertEqual(self.fs.journal_tool(["event", "get", "summary"]), - dedent( - """ - Events by type: - SUBTREEMAP: 1 - Errors: 0 - """ - ).strip()) + summary_output = self.fs.journal_tool(["event", "get", "summary"]) + try: + self.assertEqual(summary_output, + dedent( + """ + Events by type: + SUBTREEMAP: 1 + Errors: 0 + """ + ).strip()) + except AssertionError: + # In some states, flushing the journal will leave you + # an extra event from locks a client held. This is + # correct behaviour: the MDS is flushing the journal, + # it's just that new events are getting added too. + # In this case, we should nevertheless see a fully + # empty journal after a second flush. + self.assertEqual(summary_output, + dedent( + """ + Events by type: + SUBTREEMAP: 1 + UPDATE: 1 + Errors: 0 + """ + ).strip()) + flush_data = self.fs.mds_asok(["flush", "journal"]) + self.assertEqual(flush_data['return_code'], 0) + self.assertEqual(self.fs.journal_tool(["event", "get", "summary"]), + dedent( + """ + Events by type: + SUBTREEMAP: 1 + Errors: 0 + """ + ).strip()) # Now for deletion! self.mount_a.mount()