]> git.notmuchmail.org Git - notmuch/blobdiff - test/atomicity.py
lib/message: catch exception in n_m_get_thread_id
[notmuch] / test / atomicity.py
index 01a420512af11ea4b57345ec27a3cbc1a7e1ac6c..389517e1571e0b6590d068ef9cc9c13a98b44a40 100644 (file)
@@ -29,16 +29,19 @@ class RenameBreakpoint(gdb.Breakpoint):
         self.n = 0
 
     def stop(self):
-        # As an optimization, only consider snapshots after a Xapian
-        # has really committed.  Xapian overwrites record.base? as the
-        # last step in the commit, so keep an eye on their inumbers.
-        inodes = {}
-        for path in glob.glob('%s/.notmuch/xapian/record.base*' % maildir):
-            inodes[path] = os.stat(path).st_ino
-        if inodes == self.last_inodes:
-            # Continue
-            return False
-        self.last_inodes = inodes
+        xapiandir = '%s/.notmuch/xapian' % maildir
+        if os.path.isfile('%s/iamchert' % xapiandir):
+            # As an optimization, only consider snapshots after a
+            # Xapian has really committed.  The chert backend
+            # overwrites record.base? as the last step in the commit,
+            # so keep an eye on their inumbers.
+            inodes = {}
+            for path in glob.glob('%s/record.base*' % xapiandir):
+                inodes[path] = os.stat(path).st_ino
+            if inodes == self.last_inodes:
+                # Continue
+                return False
+            self.last_inodes = inodes
 
         # Save a backtrace in case the test does fail
         backtrace = gdb.execute('backtrace', to_string=True)
@@ -68,4 +71,8 @@ class RenameBreakpoint(gdb.Breakpoint):
         return False
 RenameBreakpoint('rename')
 
-gdb.execute('run')
+try:
+    gdb.execute('run')
+except Exception:
+    import traceback
+    raise SystemExit(traceback.format_exc())