summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Anderson <dda@mongodb.com>2016-11-11 09:33:39 -0500
committerKeith Bostic <keith.bostic@mongodb.com>2016-11-11 09:33:39 -0500
commit17c567ee479c4689eebc62515fd1aae58dca9603 (patch)
treea249f3dddd9fdb15f1f010bb0c03843890d2829e
parent0b0b0a9651bf789cc6744073a3f31bf2701053dc (diff)
downloadmongo-17c567ee479c4689eebc62515fd1aae58dca9603.tar.gz
WT-3016 Change how file size is determined during compact tests to allow (#3140)
it to work on systems without ftruncate support.
-rw-r--r--test/suite/test_compact02.py7
1 files 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 @@ class test_compact02(wttest.WiredTigerTestCase):
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: