diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2015-03-25 14:00:57 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2015-03-25 14:00:57 +1100 |
commit | 0fb9c1d89fc6bd3308687dbaf931ca093b078881 (patch) | |
tree | 9ade266c5004df9bc5d4de3d45da0dc3dc20c8eb | |
parent | 21eac185168dcdc022d40adff36e688e70551e05 (diff) | |
download | mongo-0fb9c1d89fc6bd3308687dbaf931ca093b078881.tar.gz |
Check that every scenario has a unique name within its test.
refs #1813
33 files changed, 131 insertions, 99 deletions
diff --git a/test/suite/test_async01.py b/test/suite/test_async01.py index 2150b16fa81..af5180192af 100644 --- a/test/suite/test_async01.py +++ b/test/suite/test_async01.py @@ -26,9 +26,10 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. +import sys, threading, wiredtiger, wttest from suite_subprocess import suite_subprocess from wiredtiger import wiredtiger_open, WiredTigerError -import sys, threading, wiredtiger, wttest +from wtscenario import check_scenarios # TODO - tmp code def tty_pr(s): @@ -121,7 +122,7 @@ class test_async01(wttest.WiredTigerTestCase, suite_subprocess): async_threads = 3 current = {} - scenarios = [ + scenarios = check_scenarios([ ('file-col', dict(tablekind='col',uri='file')), ('file-fix', dict(tablekind='fix',uri='file')), ('file-row', dict(tablekind='row',uri='file')), @@ -129,7 +130,7 @@ class test_async01(wttest.WiredTigerTestCase, suite_subprocess): ('table-col', dict(tablekind='col',uri='table')), ('table-fix', dict(tablekind='fix',uri='table')), ('table-row', dict(tablekind='row',uri='table')), - ] + ]) # Overrides WiredTigerTestCase so that we can configure # async operations. diff --git a/test/suite/test_async02.py b/test/suite/test_async02.py index 43cf520e8ed..21d811989c8 100644 --- a/test/suite/test_async02.py +++ b/test/suite/test_async02.py @@ -26,9 +26,10 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. +import sys, threading, wiredtiger, wttest from suite_subprocess import suite_subprocess from wiredtiger import wiredtiger_open, WiredTigerError -import sys, threading, wiredtiger, wttest +from wtscenario import check_scenarios # TODO - tmp code def tty_pr(s): @@ -124,7 +125,7 @@ class test_async02(wttest.WiredTigerTestCase, suite_subprocess): async_threads = 3 current = {} - scenarios = [ + scenarios = check_scenarios([ ('file-col', dict(tablekind='col',uri='file')), ('file-fix', dict(tablekind='fix',uri='file')), ('file-row', dict(tablekind='row',uri='file')), @@ -132,7 +133,7 @@ class test_async02(wttest.WiredTigerTestCase, suite_subprocess): ('table-col', dict(tablekind='col',uri='table')), ('table-fix', dict(tablekind='fix',uri='table')), ('table-row', dict(tablekind='row',uri='table')), - ] + ]) # Overrides WiredTigerTestCase so that we can configure # async operations. diff --git a/test/suite/test_backup02.py b/test/suite/test_backup02.py index b9cf0e8b59c..a56b5690ae3 100644 --- a/test/suite/test_backup02.py +++ b/test/suite/test_backup02.py @@ -28,16 +28,17 @@ import Queue import threading, time, wiredtiger, wttest -from wtthread import backup_thread, checkpoint_thread, op_thread from helper import key_populate, simple_populate +from wtthread import backup_thread, checkpoint_thread, op_thread +from wtscenario import check_scenarios # test_backup02.py # Run background checkpoints and backsups repeatedly while doing inserts # in another thread class test_backup02(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('table', dict(uri='table:test',fmt='L',dsize=100,nops=200,nthreads=1,time=30)), - ] + ]) def test_backup02(self): done = threading.Event() diff --git a/test/suite/test_backup04.py b/test/suite/test_backup04.py index fe81dc29d45..03e1e30d8a2 100644 --- a/test/suite/test_backup04.py +++ b/test/suite/test_backup04.py @@ -30,7 +30,7 @@ import Queue import threading, time, wiredtiger, wttest import glob, os, shutil from suite_subprocess import suite_subprocess -from wtscenario import multiply_scenarios, number_scenarios +from wtscenario import check_scenarios from wtthread import op_thread from helper import compare_files, key_populate @@ -54,9 +54,9 @@ class test_backup_target(wttest.WiredTigerTestCase, suite_subprocess): # and that is not what we want here. # pfx = 'test_backup' - scenarios = [ + 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. def setUpConnectionOpen(self, dir): diff --git a/test/suite/test_base02.py b/test/suite/test_base02.py index 50332518217..491899fd0ed 100644 --- a/test/suite/test_base02.py +++ b/test/suite/test_base02.py @@ -32,18 +32,19 @@ import json import wiredtiger, wttest +from wtscenario import check_scenarios # Test configuration strings. class test_base02(wttest.WiredTigerTestCase): name = 'test_base02a' extra_config = '' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:')), ('table', dict(uri='table:')), ('lsm', dict(uri='lsm:')), ('table-lsm', dict(uri='table:', extra_config=',type=lsm')), - ] + ]) def create_and_drop(self, confstr): name = self.uri + self.name diff --git a/test/suite/test_base05.py b/test/suite/test_base05.py index 74278624738..0726653d95f 100644 --- a/test/suite/test_base05.py +++ b/test/suite/test_base05.py @@ -27,6 +27,7 @@ # OTHER DEALINGS IN THE SOFTWARE. import wiredtiger, wttest +from wtscenario import check_scenarios # test_base05.py # Cursor operations @@ -39,12 +40,12 @@ class test_base05(wttest.WiredTigerTestCase): table_name1 = 'test_base05a' table_name2 = 'test_base05b' nentries = 1000 - scenarios = [ + scenarios = check_scenarios([ ('no_huffman', dict(extraconfig='')), ('huffman_key', dict(extraconfig='huffman_key="english"')), ('huffman_val', dict(extraconfig='huffman_value="english"')), ('huffman_keyval', dict(extraconfig='huffman_key="english",huffman_value="english"')) - ] + ]) def config_string(self): """ diff --git a/test/suite/test_bug006.py b/test/suite/test_bug006.py index f4a41135357..401c292c0e4 100644 --- a/test/suite/test_bug006.py +++ b/test/suite/test_bug006.py @@ -31,15 +31,16 @@ import wiredtiger, wttest from helper import key_populate, value_populate +from wtscenario import check_scenarios # Check that verify and salvage both raise exceptions if there is an open # cursor. class test_bug006(wttest.WiredTigerTestCase): name = 'test_bug006' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:')), ('table', dict(uri='table:')), - ] + ]) def test_bug006(self): uri = self.uri + self.name diff --git a/test/suite/test_bug008.py b/test/suite/test_bug008.py index 6646d188ce5..6a14201c8dd 100644 --- a/test/suite/test_bug008.py +++ b/test/suite/test_bug008.py @@ -29,16 +29,17 @@ # test_bug008.py # Regression tests. -from helper import simple_populate, key_populate, value_populate import wiredtiger, wttest +from helper import simple_populate, key_populate, value_populate +from wtscenario import check_scenarios # Tests for invisible updates. class test_bug008(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('fix', dict(fmt='key_format=r,value_format=8t', empty=1)), ('row', dict(fmt='key_format=S', empty=0)), ('var', dict(fmt='key_format=r', empty=0)) - ] + ]) # Verify cursor search and search-near operations on a file with a set of # on-page visible records, and a set of insert-list invisible records. diff --git a/test/suite/test_bulk01.py b/test/suite/test_bulk01.py index e57231cd9ef..cab1112cff0 100644 --- a/test/suite/test_bulk01.py +++ b/test/suite/test_bulk01.py @@ -32,7 +32,7 @@ import wiredtiger, wttest from helper import key_populate, value_populate -from wtscenario import multiply_scenarios, number_scenarios +from wtscenario import check_scenarios, multiply_scenarios, number_scenarios # Smoke test bulk-load. class test_bulk_load(wttest.WiredTigerTestCase): @@ -72,10 +72,10 @@ class test_bulk_load(wttest.WiredTigerTestCase): class test_bulk_load_row_order(wttest.WiredTigerTestCase): name = 'test_bulk' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(type='file:')), ('table', dict(type='table:')) - ] + ]) def test_bulk_load_row_order_check(self): uri = self.type + self.name @@ -114,10 +114,10 @@ class test_bulk_load_row_order(wttest.WiredTigerTestCase): class test_bulk_load_not_empty(wttest.WiredTigerTestCase): name = 'test_bulk' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(type='file:')), ('table', dict(type='table:')) - ] + ]) def test_bulk_load_not_empty(self): uri = self.type + self.name diff --git a/test/suite/test_checkpoint01.py b/test/suite/test_checkpoint01.py index f4ace4a9a2f..c9799700001 100644 --- a/test/suite/test_checkpoint01.py +++ b/test/suite/test_checkpoint01.py @@ -28,6 +28,7 @@ import wiredtiger, wttest from helper import key_populate, complex_populate_lsm, simple_populate +from wtscenario import check_scenarios # test_checkpoint01.py # Checkpoint tests @@ -35,10 +36,10 @@ from helper import key_populate, complex_populate_lsm, simple_populate # with a set of checkpoints, then confirm the checkpoint's values are correct, # including after other checkpoints are dropped. class test_checkpoint(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:checkpoint',fmt='S')), ('table', dict(uri='table:checkpoint',fmt='S')) - ] + ]) # Each checkpoint has a key range and a "is dropped" flag. checkpoints = { @@ -140,10 +141,10 @@ class test_checkpoint(wttest.WiredTigerTestCase): # Check some specific cursor checkpoint combinations. class test_checkpoint_cursor(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:checkpoint',fmt='S')), ('table', dict(uri='table:checkpoint',fmt='S')) - ] + ]) # Check that you cannot open a checkpoint that doesn't exist. def test_checkpoint_dne(self): @@ -206,10 +207,10 @@ class test_checkpoint_cursor(wttest.WiredTigerTestCase): # Check that you can checkpoint targets. class test_checkpoint_target(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:checkpoint',fmt='S')), ('table', dict(uri='table:checkpoint',fmt='S')) - ] + ]) def update(self, uri, value): cursor = self.session.open_cursor(uri, None, "overwrite") @@ -255,12 +256,12 @@ class test_checkpoint_target(wttest.WiredTigerTestCase): # Check that you can't write checkpoint cursors. class test_checkpoint_cursor_update(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file-r', dict(uri='file:checkpoint',fmt='r')), ('file-S', dict(uri='file:checkpoint',fmt='S')), ('table-r', dict(uri='table:checkpoint',fmt='r')), ('table-S', dict(uri='table:checkpoint',fmt='S')) - ] + ]) def test_checkpoint_cursor_update(self): simple_populate(self, self.uri, 'key_format=' + self.fmt, 100) @@ -276,10 +277,10 @@ class test_checkpoint_cursor_update(wttest.WiredTigerTestCase): # Check that WiredTigerCheckpoint works as a checkpoint specifier. class test_checkpoint_last(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:checkpoint',fmt='S')), ('table', dict(uri='table:checkpoint',fmt='S')) - ] + ]) def test_checkpoint_last(self): # Create an object, change one record to an easily recognizable string, @@ -344,10 +345,10 @@ class test_checkpoint_lsm_name(wttest.WiredTigerTestCase): class test_checkpoint_empty(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:checkpoint')), ('table', dict(uri='table:checkpoint')), - ] + ]) # Create an empty file, do one of 4 cases of checkpoint, then verify the # checkpoints exist. The reason for the 4 cases is we must create all diff --git a/test/suite/test_checkpoint02.py b/test/suite/test_checkpoint02.py index 02dcef91dc3..cf625493f7c 100644 --- a/test/suite/test_checkpoint02.py +++ b/test/suite/test_checkpoint02.py @@ -28,18 +28,18 @@ import Queue import threading, time, wiredtiger, wttest -from wtthread import checkpoint_thread, op_thread from helper import key_populate, simple_populate +from wtthread import checkpoint_thread, op_thread +from wtscenario import check_scenarios # test_checkpoint02.py # Run background checkpoints repeatedly while doing inserts and other # operations in another thread class test_checkpoint02(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('table-100', dict(uri='table:test',fmt='L',dsize=100,nops=50000,nthreads=10)), ('table-10', dict(uri='table:test',fmt='L',dsize=10,nops=50000,nthreads=30)) - ] - + ]) def test_checkpoint02(self): done = threading.Event() diff --git a/test/suite/test_cursor01.py b/test/suite/test_cursor01.py index a40a59a34c3..12b8f113095 100644 --- a/test/suite/test_cursor01.py +++ b/test/suite/test_cursor01.py @@ -27,6 +27,7 @@ # OTHER DEALINGS IN THE SOFTWARE. import wiredtiger, wttest +from wtscenario import check_scenarios # test_cursor01.py # Cursor operations @@ -40,7 +41,7 @@ class test_cursor01(wttest.WiredTigerTestCase): table_name1 = 'test_cursor01' nentries = 10 - scenarios = [ + scenarios = check_scenarios([ ('file-col', dict(tablekind='col',uri='file')), ('file-fix', dict(tablekind='fix',uri='file')), ('file-row', dict(tablekind='row',uri='file')), @@ -48,7 +49,7 @@ class test_cursor01(wttest.WiredTigerTestCase): ('table-col', dict(tablekind='col',uri='table')), ('table-fix', dict(tablekind='fix',uri='table')), ('table-row', dict(tablekind='row',uri='table')) - ] + ]) def genkey(self, i): if self.tablekind == 'row': diff --git a/test/suite/test_cursor02.py b/test/suite/test_cursor02.py index 5be3cecd1d1..e2b3ec69f86 100644 --- a/test/suite/test_cursor02.py +++ b/test/suite/test_cursor02.py @@ -28,6 +28,7 @@ import wiredtiger from test_cursor_tracker import TestCursorTracker +from wtscenario import check_scenarios # test_cursor02.py # Cursor operations on small tables. @@ -38,12 +39,12 @@ class test_cursor02(TestCursorTracker): key/value content and to track/verify content after inserts and removes. """ - scenarios = [ + scenarios = check_scenarios([ ('row', dict(tablekind='row', uri='table')), ('lsm-row', dict(tablekind='row', uri='lsm')), ('col', dict(tablekind='col', uri='table')), #('fix', dict(tablekind='fix')) - ] + ]) def create_session_and_cursor(self, ninitialentries): tablearg = self.uri + ":" + self.table_name1 diff --git a/test/suite/test_cursor04.py b/test/suite/test_cursor04.py index 43b824ee013..c9bf8140139 100644 --- a/test/suite/test_cursor04.py +++ b/test/suite/test_cursor04.py @@ -27,6 +27,7 @@ # OTHER DEALINGS IN THE SOFTWARE. import wiredtiger, wttest +from wtscenario import check_scenarios # test_base04.py # Cursor operations @@ -37,12 +38,12 @@ class test_cursor04(wttest.WiredTigerTestCase): table_name1 = 'test_cursor04' nentries = 20 - scenarios = [ + scenarios = check_scenarios([ ('row', dict(tablekind='row', uri='table')), ('lsm-row', dict(tablekind='row', uri='lsm')), ('col', dict(tablekind='col', uri='table')), ('fix', dict(tablekind='fix', uri='table')) - ] + ]) def config_string(self): """ diff --git a/test/suite/test_cursor06.py b/test/suite/test_cursor06.py index 589bcd215ee..28ac581cf66 100644 --- a/test/suite/test_cursor06.py +++ b/test/suite/test_cursor06.py @@ -29,21 +29,21 @@ import wiredtiger, wttest from helper import key_populate, value_populate, simple_populate from helper import complex_value_populate, complex_populate -from wtscenario import multiply_scenarios, number_scenarios +from wtscenario import check_scenarios # test_cursor06.py # Test cursor reconfiguration. class test_cursor06(wttest.WiredTigerTestCase): name = 'reconfigure' - scenarios = [ + scenarios = check_scenarios([ ('file-r', dict(type='file:',keyfmt='r',complex=0)), ('file-S', dict(type='file:',keyfmt='S',complex=0)), ('lsm-S', dict(type='lsm:',keyfmt='S',complex=0)), ('table-r', dict(type='table:',keyfmt='r',complex=0)), ('table-S', dict(type='table:',keyfmt='S',complex=0)), - ('table-r', dict(type='table:',keyfmt='r',complex=1)), - ('table-S', dict(type='table:',keyfmt='S',complex=1)), - ] + ('table-r-complex', dict(type='table:',keyfmt='r',complex=1)), + ('table-S-complex', dict(type='table:',keyfmt='S',complex=1)), + ]) def pop(self, uri): if self.complex == 1: diff --git a/test/suite/test_cursor07.py b/test/suite/test_cursor07.py index 099c2cf09cb..afce5bef9f2 100644 --- a/test/suite/test_cursor07.py +++ b/test/suite/test_cursor07.py @@ -33,7 +33,7 @@ import fnmatch, os, shutil, run, time from suite_subprocess import suite_subprocess from wiredtiger import wiredtiger_open, stat -from wtscenario import multiply_scenarios, number_scenarios +from wtscenario import check_scenarios import wttest class test_cursor07(wttest.WiredTigerTestCase, suite_subprocess): @@ -42,10 +42,10 @@ class test_cursor07(wttest.WiredTigerTestCase, suite_subprocess): uri = 'table:' + tablename nkeys = 5 - scenarios = [ + scenarios = check_scenarios([ ('regular', dict(reopen=False)), ('reopen', dict(reopen=True)) - ] + ]) # Overrides WiredTigerTestCase - add logging def setUpConnectionOpen(self, dir): diff --git a/test/suite/test_cursor_random.py b/test/suite/test_cursor_random.py index 75275dfde83..bcf89d722b1 100644 --- a/test/suite/test_cursor_random.py +++ b/test/suite/test_cursor_random.py @@ -29,14 +29,15 @@ import wiredtiger, wttest from helper import complex_populate, simple_populate from helper import key_populate, value_populate +from wtscenario import check_scenarios # test_cursor_random.py # Cursor next_random operations class test_cursor_random(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file', dict(type='file:',fmt='S')), ('table', dict(type='table:',fmt='S')) - ] + ]) # Check that opening a random cursor on a row-store returns not-supported # for every method except for next and reset, and next returns not-found. @@ -124,10 +125,10 @@ class test_cursor_random(wttest.WiredTigerTestCase): # Check that opening a random cursor on column-store returns not-supported. class test_cursor_random_column(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:random',fmt='r')), ('table', dict(uri='table:random',fmt='r')), - ] + ]) def test_cursor_random_column(self): self.session.create( diff --git a/test/suite/test_drop.py b/test/suite/test_drop.py index b87760f077e..0c82933b2ab 100644 --- a/test/suite/test_drop.py +++ b/test/suite/test_drop.py @@ -30,6 +30,7 @@ import os, time import wiredtiger, wttest from helper import confirm_does_not_exist, complex_populate, \ complex_populate_index_name, simple_populate +from wtscenario import check_scenarios # test_drop.py # session level drop operation @@ -37,12 +38,12 @@ class test_drop(wttest.WiredTigerTestCase): name = 'test_drop' extra_config = '' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:')), ('table', dict(uri='table:')), #Not yet: drop failing with an open cursor needs handle locking #('table-lsm', dict(uri='table:', extra_config=',type=lsm')), - ] + ]) # Populate an object, remove it and confirm it no longer exists. def drop(self, populate, with_cursor, close_session, drop_index): diff --git a/test/suite/test_dupc.py b/test/suite/test_dupc.py index 5a0a6bd67cc..c28dd928ab6 100644 --- a/test/suite/test_dupc.py +++ b/test/suite/test_dupc.py @@ -33,6 +33,7 @@ import os, time import wiredtiger, wttest from helper import complex_populate, key_populate, simple_populate +from wtscenario import check_scenarios # Test session.open_cursor with cursor duplication. class test_duplicate_cursor(wttest.WiredTigerTestCase): @@ -41,12 +42,12 @@ class test_duplicate_cursor(wttest.WiredTigerTestCase): config = 'key_format=' - scenarios = [ + scenarios = check_scenarios([ ('file-r', dict(uri='file:', fmt='r')), ('file-S', dict(uri='file:', fmt='S')), ('table-r', dict(uri='table:', fmt='r')), ('table-S', dict(uri='table:', fmt='S')) - ] + ]) # Iterate through an object, duplicate the cursor and checking that it # matches the original and is set to the same record. diff --git a/test/suite/test_empty.py b/test/suite/test_empty.py index 11821d44deb..4851d6b8317 100644 --- a/test/suite/test_empty.py +++ b/test/suite/test_empty.py @@ -29,18 +29,19 @@ import os import wiredtiger, wttest from helper import key_populate +from wtscenario import check_scenarios # test_empty.py # Test that empty objects don't write anything other than a single sector. class test_empty(wttest.WiredTigerTestCase): name = 'test_empty' - scenarios = [ + scenarios = check_scenarios([ ('file-r', dict(type='file:', fmt='r')), ('file-S', dict(type='file:', fmt='S')), ('table-r', dict(type='table:', fmt='r')), ('table-S', dict(type='table:', fmt='S')) - ] + ]) # Creating an object and then closing it shouldn't write any blocks. def test_empty_create(self): diff --git a/test/suite/test_excl.py b/test/suite/test_excl.py index da671cc2f9a..960e653e723 100644 --- a/test/suite/test_excl.py +++ b/test/suite/test_excl.py @@ -27,13 +27,14 @@ # OTHER DEALINGS IN THE SOFTWARE. import wiredtiger, wttest +from wtscenario import check_scenarios # Test session.create with the exclusive configuration. class test_create_excl(wttest.WiredTigerTestCase): - scenarios = [ + scenarios = check_scenarios([ ('file', dict(type='file:')), ('table', dict(type='table:')) - ] + ]) # Create the object with "exclusive", then assert that creation with # "exclusive" fails. diff --git a/test/suite/test_overwrite.py b/test/suite/test_overwrite.py index 7d938918324..f710035c086 100644 --- a/test/suite/test_overwrite.py +++ b/test/suite/test_overwrite.py @@ -28,19 +28,19 @@ import wiredtiger, wttest from helper import key_populate, simple_populate -from wtscenario import multiply_scenarios, number_scenarios +from wtscenario import check_scenarios # test_overwrite.py # cursor overwrite configuration method class test_overwrite(wttest.WiredTigerTestCase): name = 'overwrite' - scenarios = [ + scenarios = check_scenarios([ ('file-r', dict(type='file:',keyfmt='r')), ('file-S', dict(type='file:',keyfmt='S')), ('lsm-S', dict(type='lsm:',keyfmt='S')), ('table-r', dict(type='table:',keyfmt='r')), ('table-S', dict(type='table:',keyfmt='S')), - ] + ]) # Confirm a cursor configured with/without overwrite correctly handles # non-existent records during insert, remove and update operations. diff --git a/test/suite/test_perf001.py b/test/suite/test_perf001.py index a80c0c7e73a..415756e2255 100644 --- a/test/suite/test_perf001.py +++ b/test/suite/test_perf001.py @@ -32,17 +32,18 @@ import wiredtiger, wttest import random from time import clock, time +from wtscenario import check_scenarios # Test performance of inserting into a table with an index. class test_perf001(wttest.WiredTigerTestCase): table_name = 'test_perf001' - scenarios = [ + scenarios = check_scenarios([ #('file-file', dict(tabletype='file',indextype='file')), ('file-lsm', dict(tabletype='file',indextype='lsm')), #('lsm-file', dict(tabletype='lsm',indextype='file')), #('lsm-lsm', dict(tabletype='lsm',indextype='lsm')), - ] + ]) def setUpConnectionOpen(self, dir): wtopen_args = 'create,cache_size=512M' diff --git a/test/suite/test_rename.py b/test/suite/test_rename.py index 321b73543ae..9ab4cb13da3 100644 --- a/test/suite/test_rename.py +++ b/test/suite/test_rename.py @@ -31,6 +31,7 @@ import wiredtiger, wttest from helper import confirm_does_not_exist,\ complex_populate, complex_populate_check,\ simple_populate, simple_populate_check +from wtscenario import check_scenarios # test_rename.py # session level rename operation @@ -38,10 +39,10 @@ class test_rename(wttest.WiredTigerTestCase): name1 = 'test_rename1' name2 = 'test_rename2' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:')), ('table', dict(uri='table:')) - ] + ]) # Populate and object, and rename it a couple of times, confirming the # old name doesn't exist and the new name has the right contents. diff --git a/test/suite/test_schema02.py b/test/suite/test_schema02.py index 17a983c1551..6d3f444346d 100644 --- a/test/suite/test_schema02.py +++ b/test/suite/test_schema02.py @@ -27,6 +27,7 @@ # OTHER DEALINGS IN THE SOFTWARE. import wiredtiger, wttest +from wtscenario import check_scenarios # test_schema02.py # Columns, column groups, indexes @@ -36,10 +37,10 @@ class test_schema02(wttest.WiredTigerTestCase): """ nentries = 1000 - scenarios = [ + scenarios = check_scenarios([ ('normal', { 'idx_config' : '' }), ('lsm', { 'idx_config' : ',type=lsm' }), - ] + ]) def expect_failure_colgroup(self, name, configstr, match): self.assertRaisesWithMessage(wiredtiger.WiredTigerError, diff --git a/test/suite/test_schema03.py b/test/suite/test_schema03.py index 5db6966f634..20e173cc215 100644 --- a/test/suite/test_schema03.py +++ b/test/suite/test_schema03.py @@ -29,6 +29,7 @@ import os import suite_random import wiredtiger, wtscenario, wttest +from wtscenario import check_scenarios try: # Windows does not getrlimit/setrlimit so we must catch the resource @@ -245,7 +246,7 @@ class test_schema03(wttest.WiredTigerTestCase): # but boost it up to this limit anyway. OPEN_FILE_LIMIT = 1000 - restart_scenarios = [('table', dict(s_restart=['table'],P=0.3)), + restart_scenarios = check_scenarios([('table', dict(s_restart=['table'],P=0.3)), ('colgroup0', dict(s_restart=['colgroup0'],P=0.3)), ('index0', dict(s_restart=['index0'],P=0.3)), ('colgroup1', dict(s_restart=['colgroup1'],P=0.3)), @@ -254,7 +255,8 @@ class test_schema03(wttest.WiredTigerTestCase): ('index2', dict(s_restart=['index2'],P=0.3)), ('populate1', dict(s_restart=['populate1'],P=0.3)), ('ipop', dict(s_restart=['index0','populate0'],P=0.3)), - ('all', dict(s_restart=['table','colgroup0','index0','colgroup1','index1','populate0','index2','populate1'],P=1.0))] + ('all', dict(s_restart=['table','colgroup0','index0','colgroup1','index1','populate0','index2','populate1'],P=1.0)), + ]) ntable_scenarios = wtscenario.quick_scenarios('s_ntable', [1,2,5,8], [1.0,0.4,0.5,0.5]) diff --git a/test/suite/test_truncate01.py b/test/suite/test_truncate01.py index c74c9bdfe91..53735318d0f 100644 --- a/test/suite/test_truncate01.py +++ b/test/suite/test_truncate01.py @@ -34,16 +34,16 @@ import wiredtiger, wttest from helper import confirm_empty,\ key_populate, value_populate, simple_populate,\ complex_populate, complex_value_populate -from wtscenario import multiply_scenarios, number_scenarios +from wtscenario import check_scenarios, multiply_scenarios, number_scenarios # Test truncation arguments. class test_truncate_arguments(wttest.WiredTigerTestCase): name = 'test_truncate' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(type='file:')), ('table', dict(type='table:')) - ] + ]) # Test truncation without URI or cursors specified, or with a URI and # either cursor specified, expect errors. @@ -80,10 +80,10 @@ class test_truncate_arguments(wttest.WiredTigerTestCase): # Test truncation of an object using its URI. class test_truncate_uri(wttest.WiredTigerTestCase): name = 'test_truncate' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(type='file:')), ('table', dict(type='table:')) - ] + ]) # Populate an object, truncate it by URI, and confirm it's empty. def test_truncate_uri(self): diff --git a/test/suite/test_txn01.py b/test/suite/test_txn01.py index fec90938547..94e65ff0f48 100644 --- a/test/suite/test_txn01.py +++ b/test/suite/test_txn01.py @@ -27,19 +27,20 @@ # OTHER DEALINGS IN THE SOFTWARE. import wiredtiger, wttest +from wtscenario import check_scenarios # test_txn01.py # Transactions: basic functionality class test_txn01(wttest.WiredTigerTestCase): nentries = 1000 - scenarios = [ + scenarios = check_scenarios([ ('col-f', dict(uri='file:text_txn01',key_format='r',value_format='S')), ('col-t', dict(uri='table:text_txn01',key_format='r',value_format='S')), ('fix-f', dict(uri='file:text_txn01',key_format='r',value_format='8t')), ('fix-t', dict(uri='table:text_txn01',key_format='r',value_format='8t')), ('row-f', dict(uri='file:text_txn01',key_format='S',value_format='S')), ('row-t', dict(uri='table:text_txn01',key_format='S',value_format='S')), - ] + ]) # Overrides WiredTigerTestCase def setUpConnectionOpen(self, dir): diff --git a/test/suite/test_txn03.py b/test/suite/test_txn03.py index 4f202979fe4..4025dbb1117 100644 --- a/test/suite/test_txn03.py +++ b/test/suite/test_txn03.py @@ -31,7 +31,7 @@ # import wiredtiger, wttest -from wtscenario import multiply_scenarios, number_scenarios +from wtscenario import check_scenarios class test_txn03(wttest.WiredTigerTestCase): tablename = 'test_txn03' @@ -42,9 +42,9 @@ class test_txn03(wttest.WiredTigerTestCase): data_str2 = "TEST_VAL1" nentries = 1000 - scenarios = [ + scenarios = check_scenarios([ ('var', dict(create_params = "key_format=S,value_format=S")), - ] + ]) # Overrides WiredTigerTestCase def setUpConnectionOpen(self, dir): diff --git a/test/suite/test_upgrade.py b/test/suite/test_upgrade.py index 24cecf4b518..df8024413cc 100644 --- a/test/suite/test_upgrade.py +++ b/test/suite/test_upgrade.py @@ -29,16 +29,17 @@ import os, time import wiredtiger, wttest from helper import complex_populate, simple_populate +from wtscenario import check_scenarios # test_upgrade.py # session level upgrade operation class test_upgrade(wttest.WiredTigerTestCase): name = 'test_upgrade' - scenarios = [ + scenarios = check_scenarios([ ('file', dict(uri='file:')), ('table', dict(uri='table:')) - ] + ]) # Populate an object, then upgrade it. def upgrade(self, populate, with_cursor): diff --git a/test/suite/test_util02.py b/test/suite/test_util02.py index e95746e2946..76a35695a5f 100644 --- a/test/suite/test_util02.py +++ b/test/suite/test_util02.py @@ -27,8 +27,9 @@ # OTHER DEALINGS IN THE SOFTWARE. import string, os -from suite_subprocess import suite_subprocess import wiredtiger, wttest +from suite_subprocess import suite_subprocess +from wtscenario import check_scenarios # test_util02.py # Utilities: wt load @@ -42,12 +43,12 @@ class test_util02(wttest.WiredTigerTestCase, suite_subprocess): nentries = 1000 stringclass = ''.__class__ - scenarios = [ + scenarios = check_scenarios([ ('SS', dict(key_format='S',value_format='S')), ('rS', dict(key_format='r',value_format='S')), ('ri', dict(key_format='r',value_format='i')), ('ii', dict(key_format='i',value_format='i')), - ] + ]) def get_string(self, i, len): """ diff --git a/test/suite/test_util03.py b/test/suite/test_util03.py index aa5d723fbe8..9e3c81334ec 100644 --- a/test/suite/test_util03.py +++ b/test/suite/test_util03.py @@ -28,6 +28,7 @@ from suite_subprocess import suite_subprocess import wiredtiger, wttest +from wtscenario import check_scenarios # test_util03.py # Utilities: wt create @@ -35,12 +36,12 @@ class test_util03(wttest.WiredTigerTestCase, suite_subprocess): tablename = 'test_util03.a' nentries = 1000 - scenarios = [ + scenarios = check_scenarios([ ('none', dict(key_format=None,value_format=None)), ('SS', dict(key_format='S',value_format='S')), ('rS', dict(key_format='r',value_format='S')), ('ri', dict(key_format='r',value_format='i')), - ] + ]) def test_create_process(self): """ diff --git a/test/suite/wtscenario.py b/test/suite/wtscenario.py index 2e59c704971..6e4b0d3464e 100644 --- a/test/suite/wtscenario.py +++ b/test/suite/wtscenario.py @@ -64,6 +64,13 @@ def log2chr(val): megabyte = 1024 * 1024 +def check_scenarios(scenes): + """ + Make sure all scenarios have unique names + """ + assert len(scenes) == len(dict(scenes)) + return scenes + def multiply_scenarios(sep, *args): """ Create the cross product of two lists of scenarios @@ -90,7 +97,7 @@ def multiply_scenarios(sep, *args): tdict['P'] = P total.append((name, tdict)) result = total - return result + return check_scenarios(result) def prune_sorter_key(scene): """ @@ -161,7 +168,7 @@ def prune_scenarios(scenes, default_count = -1, long_count = -1): for scene in scenes: del scene[1]['_rand'] del scene[1]['_order'] - return scenes + return check_scenarios(scenes) def number_scenarios(scenes): """ @@ -173,7 +180,7 @@ def number_scenarios(scenes): scene[1]['scenario_name'] = scene[0] scene[1]['scenario_number'] = count count += 1 - return scenes + return check_scenarios(scenes) def quick_scenarios(fieldname, values, probabilities): """ |