Skip to content

Commit

Permalink
WT-3016 Change how file size is determined during compact tests to al…
Browse files Browse the repository at this point in the history
…low (#3140)

it to work on systems without ftruncate support.
  • Loading branch information
ddanderson authored and keithbostic committed Nov 11, 2016
1 parent 0b0b0a9 commit 17c567e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/suite/test_compact02.py
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 17c567e

Please sign in to comment.