]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: ceph_test_filejournal Add check of journalq in WriteTrim test
authorDavid Zafman <dzafman@redhat.com>
Fri, 20 Feb 2015 03:48:11 +0000 (19:48 -0800)
committerDavid Zafman <dzafman@redhat.com>
Thu, 25 Feb 2016 20:50:22 +0000 (12:50 -0800)
Commit all journal entries and check for empty journalq

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 8da4d9f6330c57d6b437ea44f54f147075e24195)

src/os/FileJournal.h
src/test/test_filejournal.cc

index 71d7f2257b5e467be37f94035998d75259e1e895..9e07b4046d97dc958b07becdeb572d5ae400e2aa 100644 (file)
@@ -214,6 +214,8 @@ public:
     }
   } __attribute__((__packed__, aligned(4)));
 
+  bool journalq_empty() { return journalq.empty(); }
+
 private:
   string fn;
 
index befe761400db918aef4a1ee5696c31eaa77090a1..5bbaab1c99fb076fe999470a391c157654ff4ef0 100644 (file)
@@ -360,9 +360,11 @@ TEST(TestFileJournal, WriteTrim) {
   while (ls.size()) {
     delete ls.front();
     ls.pop_front();
-    j.committed_thru(committed);
+    j.committed_thru(++committed);
   }
 
+  ASSERT_TRUE(j.journalq_empty());
+
   j.close();
 }