summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-10-19 14:46:22 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-10-19 14:46:22 +1100
commit2df7517b895a986721871f27f8a2d1b29edff7fa (patch)
tree505539b6df83e93760daac00f98eb0ac49f7a1d4
parenta064c45bfc945152dc178d5c3a35889f87eddc9e (diff)
downloadmongo-2df7517b895a986721871f27f8a2d1b29edff7fa.tar.gz
Get test_schema03 running with LSM.
Significantly crank down the size of the schemas it generates: it is better to have it running consistently with moderate-sized scenarios than requiring so many resources that we avoid running it in normal testing.
-rw-r--r--test/suite/test_schema03.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/test/suite/test_schema03.py b/test/suite/test_schema03.py
index 53e2ff86587..307c4dab541 100644
--- a/test/suite/test_schema03.py
+++ b/test/suite/test_schema03.py
@@ -249,13 +249,17 @@ class test_schema03(wttest.WiredTigerTestCase):
('all', dict(s_restart=['table','colgroup0','index0','colgroup1','index1','populate0','index2','populate1'],P=1.0))]
ntable_scenarios = wtscenario.quick_scenarios('s_ntable',
- [1,2,7,43], [1.0,0.4,0.5,0.5])
+ [1,2,5,8], [1.0,0.4,0.5,0.5])
ncolgroup_scenarios = wtscenario.quick_scenarios('s_colgroup',
- [[1,0],[0,1],[2,4],[18,5]], [1.0,0.2,0.3,1.0])
+ [[1,0],[0,1],[2,4],[8,5]], [1.0,0.2,0.3,1.0])
nindex_scenarios = wtscenario.quick_scenarios('s_index',
- [[1,1,1],[3,2,4],[15,7,3]], [1.0,0.5,1.0])
+ [[1,1,1],[3,2,1],[5,1,3]], [1.0,0.5,1.0])
+ idx_args_scenarios = wtscenario.quick_scenarios('s_index_args',
+ ['', ',type=file', ',type=lsm'], [0.5, 0.3, 0.2])
+ table_args_scenarios = wtscenario.quick_scenarios('s_extra_table_args',
+ ['', ',type=file', ',type=lsm'], [0.5, 0.3, 0.2])
- all_scenarios = wtscenario.multiply_scenarios('_', restart_scenarios, ntable_scenarios, ncolgroup_scenarios, nindex_scenarios)
+ all_scenarios = wtscenario.multiply_scenarios('_', restart_scenarios, ntable_scenarios, ncolgroup_scenarios, nindex_scenarios, idx_args_scenarios, table_args_scenarios)
# Prune the scenarios according to the probabilities given above.
scenarios = wtscenario.prune_scenarios(all_scenarios, 30)
@@ -281,9 +285,8 @@ class test_schema03(wttest.WiredTigerTestCase):
super(test_schema03, self).setUp()
def setUpConnectionOpen(self, dir):
- cs = 100 * 1024 * 1024
- conn = wiredtiger.wiredtiger_open(dir, 'create,cache_size=' +
- str(cs) + ',hazard_max=300')
+ conn = wiredtiger.wiredtiger_open(dir,
+ 'create,cache_size=100m,session_max=1000')
self.pr(`conn`)
return conn
@@ -292,9 +295,6 @@ class test_schema03(wttest.WiredTigerTestCase):
resource.setrlimit(resource.RLIMIT_NOFILE, self.origFileLimit)
def gen_formats(self, rand, n, iskey):
- if iskey and n == 1:
- if rand.rand_range(0, 2) == 0:
- return 'r' # record number
result = ''
for i in range(0, n):
if rand.rand_range(0, 2) == 0:
@@ -312,11 +312,12 @@ class test_schema03(wttest.WiredTigerTestCase):
def join_names(self, sep, prefix, list):
return sep.join([prefix + str(val) for val in list])
- def create(self, what, tablename, whatname, columnlist):
+ def create(self, what, tablename, whatname, columnlist, extra_args=''):
createarg = what + ":" + tablename + ":" + whatname
colarg = self.join_names(',', 'c', columnlist)
- self.show_python("self.session.create('" + createarg + "', 'columns=(" + colarg + ")')")
- result = self.session.create(createarg, "columns=(" + colarg + ")")
+ self.show_python("self.session.create('" + createarg + "', 'columns=(" + colarg + ")" + extra_args + "')")
+ result = self.session.create(createarg,
+ "columns=(" + colarg + ")" + extra_args)
self.assertEqual(result, 0)
def finished_step(self, name):
@@ -418,6 +419,7 @@ class test_schema03(wttest.WiredTigerTestCase):
config += ","
config += "g" + str(j)
config += ")"
+ config += self.s_extra_table_args
# indices are not declared here
self.show_python("self.session.create('table:" + tc.tablename + "', '" + config + "')")
self.session.create("table:" + tc.tablename, config)
@@ -444,7 +446,7 @@ class test_schema03(wttest.WiredTigerTestCase):
self.current_table = tc.tableidx
for idx in tc.idxlist:
if idx.createset == createset:
- self.create('index', tc.tablename, idx.idxname, idx.columns)
+ self.create('index', tc.tablename, idx.idxname, idx.columns, self.s_index_args)
self.finished_step('index' + str(createset))