aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2016-04-08 22:49:48 -0300
committerDavid Bremner <david@tethera.net>2016-04-12 20:11:53 -0300
commit45a0ab9e842e075fba6c30f303564e503e0cea99 (patch)
treefbcbc48f2f945bbf03f36b13750be7daf4c93c71 /test
parent45df509cb6fd642bc5895f2c7869a354c1255f4b (diff)
test/atomicity: guard chert-only optimization
This should potentially be updated to have an equivalent optimization for the glass backend, but it in my unscientific tests, the glass backend without the optimization is faster then the chert backend with.
Diffstat (limited to 'test')
-rw-r--r--test/atomicity.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/test/atomicity.py b/test/atomicity.py
index 01a42051..1ca52b9c 100644
--- a/test/atomicity.py
+++ b/test/atomicity.py
@@ -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)