WT-2142. In test suite, replace lambda expressions by functions.

This commit is contained in:
Don Anderson
2016-01-01 11:20:29 -05:00
parent fa209c1357
commit acd25d4e98
12 changed files with 44 additions and 31 deletions

View File

@@ -132,9 +132,10 @@ class test_async01(wttest.WiredTigerTestCase, suite_subprocess):
('table-row', dict(tablekind='row',uri='table')),
])
conn_config = lambda self, dir: \
'async=(enabled=true,ops_max=%s,' % self.async_ops + \
'threads=%s)' % self.async_threads
# Enable async for this test.
def conn_config(self, dir):
return 'async=(enabled=true,ops_max=%s,' % self.async_ops + \
'threads=%s)' % self.async_threads
def genkey(self, i):
if self.tablekind == 'row':

View File

@@ -129,9 +129,10 @@ class test_async02(wttest.WiredTigerTestCase, suite_subprocess):
('table-row', dict(tablekind='row',uri='table')),
])
conn_config = lambda self, dir: \
'async=(enabled=true,ops_max=%s,' % self.async_ops + \
'threads=%s)' % self.async_threads
# Enable async for this test.
def conn_config(self, dir):
return 'async=(enabled=true,ops_max=%s,' % self.async_ops + \
'threads=%s)' % self.async_threads
def genkey(self, i):
if self.tablekind == 'row':

View File

@@ -57,9 +57,10 @@ class test_backup_target(wttest.WiredTigerTestCase, suite_subprocess):
scenarios = check_scenarios([
('table', dict(uri='table:test',dsize=100,nops=2000,nthreads=1,time=30)),
])
# Create a large cache, otherwise this test runs quite slowly.
conn_config = lambda self, dir: \
'cache_size=1G,log=(archive=false,enabled,file_max=%s)' % \
def conn_config(self, dir):
return 'cache_size=1G,log=(archive=false,enabled,file_max=%s)' % \
self.logmax
def populate(self, uri, dsize, rows):

View File

@@ -40,8 +40,9 @@ class test_bug011(wttest.WiredTigerTestCase):
ntables = 50
nrows = 10000
nops = 10000
conn_config = lambda self, dir: \
'cache_size=10MB,hazard_max=' + str(self.ntables / 2)
# Add connection configuration for this test.
def conn_config(self, dir):
return 'cache_size=10MB,hazard_max=' + str(self.ntables / 2)
def test_eviction(self):
cursors = []

View File

@@ -52,8 +52,9 @@ class test_compress01(wttest.WiredTigerTestCase):
nrecords = 10000
bigvalue = "abcdefghij" * 1000
conn_config = lambda self, dir: \
self.extensionArg(self.compress)
# Load the compression extension, compression is enabled elsewhere.
def conn_config(self, dir):
return self.extensionArg(self.compress)
# Return the wiredtiger_open extension argument for a shared library.
def extensionArg(self, name):

View File

@@ -48,9 +48,10 @@ class test_cursor07(wttest.WiredTigerTestCase, suite_subprocess):
('regular', dict(reopen=False)),
('reopen', dict(reopen=True))
])
conn_config = lambda self, dir: \
'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
'transaction_sync="(method=dsync,enabled)"'
# Enable logging for this test.
def conn_config(self, dir):
return 'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
'transaction_sync="(method=dsync,enabled)"'
def test_log_cursor(self):
# print "Creating %s with config '%s'" % (self.uri, self.create_params)

View File

@@ -54,11 +54,12 @@ class test_cursor08(wttest.WiredTigerTestCase, suite_subprocess):
('none', dict(compress='none')),
])
scenarios = number_scenarios(multiply_scenarios('.', reopens, compress))
conn_config = lambda self, dir: \
'log=(archive=false,enabled,file_max=%s,' % self.logmax + \
'compressor=%s),' % self.compress + \
'transaction_sync="(method=dsync,enabled)",' + \
self.extensionArg(self.compress)
# Load the compression extension, and enable it for logging.
def conn_config(self, dir):
return 'log=(archive=false,enabled,file_max=%s,' % self.logmax + \
'compressor=%s),' % self.compress + \
'transaction_sync="(method=dsync,enabled)",' + \
self.extensionArg(self.compress)
# Return the wiredtiger_open extension argument for a shared library.
def extensionArg(self, name):

View File

@@ -60,7 +60,9 @@ class test_stat_cursor_config(wttest.WiredTigerTestCase):
scenarios = number_scenarios(
multiply_scenarios('.', uri, data_config, cursor_config))
conn_config = lambda self, dir: 'statistics=(%s)' % self.data_config
# Turn on statistics for this test.
def conn_config(self, dir):
return 'statistics=(%s)' % self.data_config
# For each database/cursor configuration, confirm the right combinations
# succeed or fail.

View File

@@ -41,9 +41,10 @@ class test_txn08(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_txn08'
uri = 'table:' + tablename
conn_config = lambda self, dir: \
'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
'transaction_sync="(method=dsync,enabled)"'
# Turn on logging for this test.
def conn_config(self, dir):
return 'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
'transaction_sync="(method=dsync,enabled)"'
def test_printlog_unicode(self):
# print "Creating %s with config '%s'" % (self.uri, self.create_params)

View File

@@ -43,8 +43,9 @@ class test_txn11(wttest.WiredTigerTestCase, suite_subprocess):
source_uri = 'table:' + tablename + "_src"
uri = 'table:' + tablename
conn_config = lambda self, dir: \
'log=(archive=%s,' % self.archive + \
# Turn on logging for this test.
def conn_config(self, dir):
return 'log=(archive=%s,' % self.archive + \
'enabled,file_max=%s,prealloc=false),' % self.logmax + \
'transaction_sync=(enabled=false),'

View File

@@ -49,9 +49,10 @@ class test_txn13(wttest.WiredTigerTestCase, suite_subprocess):
('4gb', dict(expect_err=True, valuesize=4194304))
])
conn_config = lambda self, dir: \
'log=(archive=false,enabled,file_max=%s)' % self.logmax + \
',cache_size=8G'
# Turn on logging for this test.
def conn_config(self, dir):
return 'log=(archive=false,enabled,file_max=%s)' % self.logmax + \
',cache_size=8G'
@wttest.longtest('txn tests with huge values')
def test_large_values(self):

View File

@@ -40,8 +40,9 @@ class test_txn15(wttest.WiredTigerTestCase, suite_subprocess):
uri = 'table:test_txn15_1'
create_params = 'key_format=i,value_format=i'
entries = 100
conn_config = lambda self, dir: \
'statistics=(fast),' + \
# Turn on logging for this test.
def conn_config(self, dir):
return 'statistics=(fast),' + \
'log=(archive=false,enabled,file_max=100K),' + \
'use_environment=false,' + \
'transaction_sync=(enabled=%s),' % self.conn_enable + \