From 17c567ee479c4689eebc62515fd1aae58dca9603 Mon Sep 17 00:00:00 2001 From: Don Anderson Date: Fri, 11 Nov 2016 09:33:39 -0500 Subject: [PATCH] WT-3016 Change how file size is determined during compact tests to allow (#3140) it to work on systems without ftruncate support. --- test/suite/test_compact02.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/suite/test_compact02.py b/test/suite/test_compact02.py index fe31aa1cbe1..3a4ca6cbc7e 100644 --- a/test/suite/test_compact02.py +++ b/test/suite/test_compact02.py @@ -80,8 +80,11 @@ class test_compact02(wttest.WiredTigerTestCase): # Return the size of the file def getSize(self): + # To allow this to work on systems without ftruncate, + # get the portion of the file allocated, via 'statistics=(all)', + # not the physical file size, via 'statistics=(size)'. cstat = self.session.open_cursor( - 'statistics:' + self.uri, None, 'statistics=(size)') + 'statistics:' + self.uri, None, 'statistics=(all)') sz = cstat[stat.dsrc.block_size][2] cstat.close() return sz @@ -96,7 +99,7 @@ def ConnectionOpen(self, cacheSize): self.home = '.' conn_params = 'create,' + \ cacheSize + ',error_prefix="%s: ",' % self.shortid() + \ - 'statistics=(fast),eviction_dirty_target=99,eviction_dirty_trigger=99' + 'statistics=(all),eviction_dirty_target=99,eviction_dirty_trigger=99' try: self.conn = wiredtiger.wiredtiger_open(self.home, conn_params) except wiredtiger.WiredTigerError as e: