diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2012-11-30 09:53:35 +1100 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2012-11-30 09:53:35 +1100 |
commit | c2a46d144ecb5dadb5fa40b4bc7ee680b12e1c3e (patch) | |
tree | 9cfdb0b16468a3f1b0d3bc93cb78c44ba89e0a1d | |
parent | 909705ed06e54a31288d8cf606f316c00efe3b7f (diff) | |
parent | 31c862d5e9938777a8c662ccfb0309d44ccc9de6 (diff) | |
download | mongo-c2a46d144ecb5dadb5fa40b4bc7ee680b12e1c3e.tar.gz |
Merge branch 'develop' into trickle
-rw-r--r-- | dist/api_data.py | 4 | ||||
-rw-r--r-- | dist/s_style | 6 | ||||
-rw-r--r-- | src/config/config_def.c | 22 | ||||
-rw-r--r-- | src/utilities/util_misc.c | 7 | ||||
-rw-r--r-- | test/format/util.c | 29 | ||||
-rw-r--r-- | test/suite/helper.py | 4 | ||||
-rw-r--r-- | test/suite/test_backup.py | 4 | ||||
-rw-r--r-- | test/suite/test_base04.py | 4 | ||||
-rw-r--r-- | test/suite/test_bug001.py | 2 | ||||
-rw-r--r-- | test/suite/test_checkpoint01.py | 8 | ||||
-rw-r--r-- | test/suite/test_compact.py | 2 | ||||
-rw-r--r-- | test/suite/test_compress01.py | 172 | ||||
-rw-r--r-- | test/suite/test_config03.py | 2 | ||||
-rw-r--r-- | test/suite/test_empty.py | 14 | ||||
-rw-r--r-- | test/suite/test_index01.py | 10 | ||||
-rw-r--r-- | test/suite/test_nocache.py | 2 | ||||
-rw-r--r-- | test/suite/test_overwrite.py | 2 | ||||
-rw-r--r-- | test/suite/test_schema03.py | 2 | ||||
-rw-r--r-- | test/suite/test_truncate01.py | 2 | ||||
-rw-r--r-- | test/suite/test_txn02.py | 4 | ||||
-rw-r--r-- | test/suite/wttest.py | 2 | ||||
-rw-r--r-- | test/suite/wtthread.py | 4 |
22 files changed, 139 insertions, 169 deletions
diff --git a/dist/api_data.py b/dist/api_data.py index ff43d1956b8..e1f7a5341bc 100644 --- a/dist/api_data.py +++ b/dist/api_data.py @@ -233,7 +233,7 @@ table_only_meta = [ colgroup_meta = column_meta + source_meta -index_meta = column_meta + format_meta + source_meta +index_meta = format_meta + source_meta table_meta = format_meta + table_only_meta @@ -321,7 +321,7 @@ methods = { min='10', max='50'), ]), -'session.create' : Method(table_meta + file_config + source_meta + [ +'session.create' : Method(table_only_meta + file_config + source_meta + [ Config('exclusive', 'false', r''' fail if the object exists. When false (the default), if the object exists, check that its settings match the specified diff --git a/dist/s_style b/dist/s_style index b8f55cc5b89..f5835e58106 100644 --- a/dist/s_style +++ b/dist/s_style @@ -101,3 +101,9 @@ test -s $t && { echo '[tab] characters appear in test suite scripts:' cat $t } +# Check for trailing semi-colons. +egrep ';$' test/suite/*.py > $t +test -s $t && { + echo 'trailing semi-colon characters appear in test suite scripts:' + cat $t +} diff --git a/src/config/config_def.c b/src/config/config_def.c index 73d298242d9..d65fad2a92c 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -175,12 +175,11 @@ __wt_confchk_file_meta[] = { const char * __wt_confdfl_index_meta = - "columns=,columns=,key_format=u,source=,type=file,value_format=u"; + "columns=,key_format=u,source=,type=file,value_format=u"; WT_CONFIG_CHECK __wt_confchk_index_meta[] = { { "columns", "list", NULL, NULL}, - { "columns", "list", NULL, NULL}, { "key_format", "format", NULL, NULL}, { "source", "string", NULL, NULL}, { "type", "string", "choices=[\"file\",\"lsm\"]", NULL}, @@ -249,14 +248,14 @@ __wt_confchk_session_compact[] = { const char * __wt_confdfl_session_create = "allocation_size=512B,block_compressor=,cache_resident=0,checksum=on," - "colgroups=,collator=,columns=,columns=,dictionary=0,exclusive=0," - "format=btree,huffman_key=,huffman_value=,internal_item_max=0," - "internal_key_truncate=,internal_page_max=2KB,key_format=u," - "key_format=u,key_gap=10,leaf_item_max=0,leaf_page_max=1MB,lsm_bloom=" - ",lsm_bloom_bit_count=8,lsm_bloom_config=,lsm_bloom_hash_count=4," - "lsm_bloom_newest=0,lsm_bloom_oldest=0,lsm_chunk_size=2MB," - "lsm_merge_max=15,lsm_merge_threads=1,prefix_compression=,source=," - "split_pct=75,type=file,value_format=u,value_format=u"; + "colgroups=,collator=,columns=,dictionary=0,exclusive=0,format=btree," + "huffman_key=,huffman_value=,internal_item_max=0," + "internal_key_truncate=,internal_page_max=2KB,key_format=u,key_gap=10" + ",leaf_item_max=0,leaf_page_max=1MB,lsm_bloom=,lsm_bloom_bit_count=8," + "lsm_bloom_config=,lsm_bloom_hash_count=4,lsm_bloom_newest=0," + "lsm_bloom_oldest=0,lsm_chunk_size=2MB,lsm_merge_max=15," + "lsm_merge_threads=1,prefix_compression=,source=,split_pct=75," + "type=file,value_format=u"; WT_CONFIG_CHECK __wt_confchk_session_create[] = { @@ -269,7 +268,6 @@ __wt_confchk_session_create[] = { { "colgroups", "list", NULL, NULL}, { "collator", "string", NULL, NULL}, { "columns", "list", NULL, NULL}, - { "columns", "list", NULL, NULL}, { "dictionary", "int", "min=0", NULL}, { "exclusive", "boolean", NULL, NULL}, { "format", "string", "choices=[\"btree\"]", NULL}, @@ -279,7 +277,6 @@ __wt_confchk_session_create[] = { { "internal_key_truncate", "boolean", NULL, NULL}, { "internal_page_max", "int", "min=512B,max=512MB", NULL}, { "key_format", "format", NULL, NULL}, - { "key_format", "format", NULL, NULL}, { "key_gap", "int", "min=0", NULL}, { "leaf_item_max", "int", "min=0", NULL}, { "leaf_page_max", "int", "min=512B,max=512MB", NULL}, @@ -297,7 +294,6 @@ __wt_confchk_session_create[] = { { "split_pct", "int", "min=25,max=100", NULL}, { "type", "string", "choices=[\"file\",\"lsm\"]", NULL}, { "value_format", "format", NULL, NULL}, - { "value_format", "format", NULL, NULL}, { NULL, NULL, NULL, NULL } }; diff --git a/src/utilities/util_misc.c b/src/utilities/util_misc.c index 473a87588f0..bd1df294bbe 100644 --- a/src/utilities/util_misc.c +++ b/src/utilities/util_misc.c @@ -50,6 +50,11 @@ util_read_line(ULINE *l, int eof_expected, int *eofp) ++line; *eofp = 0; + if (l->memsize == 0) { + if ((l->mem = realloc(l->mem, l->memsize + 1024)) == NULL) + return (util_err(errno, NULL)); + l->memsize = 1024; + } for (len = 0;; ++len) { if ((ch = getchar()) == EOF) { if (len == 0) { @@ -70,7 +75,7 @@ util_read_line(ULINE *l, int eof_expected, int *eofp) * line into a record number, that means we always need one * extra byte at the end. */ - if (l->memsize == 0 || len >= l->memsize - 1) { + if (len >= l->memsize - 1) { if ((l->mem = realloc(l->mem, l->memsize + 1024)) == NULL) return (util_err(errno, NULL)); diff --git a/test/format/util.c b/test/format/util.c index 6b0a4c120c4..5b0faff4008 100644 --- a/test/format/util.c +++ b/test/format/util.c @@ -203,16 +203,9 @@ track(const char *tag, uint64_t cnt, TINFO *tinfo) uint32_t wts_rand(void) { - static int seeded = 0; char buf[64]; uint32_t r; - /* If it's not a replay, seed the random number generator. */ - if (!g.replay && !seeded) { - srand((u_int)(0xdeadbeef ^ (u_int)time(NULL))); - seeded = 1; - } - /* If we're threaded, it's not repeatable, ignore the log. */ if (!SINGLETHREADED) return ((uint32_t)rand()); @@ -225,14 +218,11 @@ wts_rand(void) * internally, and so that messes up the pattern of random numbers * (and WT might call rand() in the future, who knows?) */ - if (g.rand_log == NULL) { - if ((g.rand_log = - fopen("RUNDIR/rand", g.replay ? "r" : "w")) == NULL) - die(errno, "fopen: RUNDIR/rand"); - if (!g.replay) - (void)setvbuf(g.rand_log, NULL, _IOLBF, 0); - } if (g.replay) { + if (g.rand_log == NULL && + (g.rand_log = fopen("RUNDIR/rand", "r")) == NULL) + die(errno, "fopen: RUNDIR/rand"); + if (fgets(buf, sizeof(buf), g.rand_log) == NULL) { if (feof(g.rand_log)) { fprintf(stderr, @@ -245,6 +235,17 @@ wts_rand(void) r = (uint32_t)strtoul(buf, NULL, 10); } else { + if (g.rand_log == NULL) { + if ((g.rand_log = fopen("RUNDIR/rand", "w")) == NULL) + die(errno, "fopen: RUNDIR/rand"); + (void)setvbuf(g.rand_log, NULL, _IOLBF, 0); + + /* + * Seed the random number generator for each new run (we + * know it's a new run when we re-open the log file). + */ + srand((u_int)(0xdeadbeef ^ (u_int)time(NULL))); + } r = (uint32_t)rand(); fprintf(g.rand_log, "%" PRIu32 "\n", r); } diff --git a/test/suite/helper.py b/test/suite/helper.py index 1a7f9216c85..65ba847ff59 100644 --- a/test/suite/helper.py +++ b/test/suite/helper.py @@ -63,7 +63,7 @@ def compare_tables(self, session, uris, config=None): for next_cursor in cursors: if (next_cursor.next() == wiredtiger.WT_NOTFOUND): done = True - break; + break keys.append(next_cursor.get_value()) match = all(x == keys[0] for x in keys) if not match: @@ -145,7 +145,7 @@ def simple_populate_check(self, uri): i += 1 self.assertEqual(key, key_populate(cursor, i)) if cursor.value_format == '8t' and val == 0: # deleted - continue; + continue self.assertEqual(val, value_populate(cursor, i)) cursor.close() diff --git a/test/suite/test_backup.py b/test/suite/test_backup.py index 3984b3f74b0..95903ad3064 100644 --- a/test/suite/test_backup.py +++ b/test/suite/test_backup.py @@ -151,7 +151,7 @@ class test_backup(wttest.WiredTigerTestCase, suite_subprocess): while True: ret = cursor.next() if ret != 0: - break; + break i += 1 self.assertEqual(ret, wiredtiger.WT_NOTFOUND) total = i * 2 @@ -159,7 +159,7 @@ class test_backup(wttest.WiredTigerTestCase, suite_subprocess): while True: ret = cursor.next() if ret != 0: - break; + break i += 1 self.assertEqual(ret, wiredtiger.WT_NOTFOUND) self.assertEqual(i, total) diff --git a/test/suite/test_base04.py b/test/suite/test_base04.py index 184fde48716..d1f1e97a9ec 100644 --- a/test/suite/test_base04.py +++ b/test/suite/test_base04.py @@ -67,7 +67,7 @@ class test_base04(wttest.WiredTigerTestCase): def insert(self, key, value): self.pr('insert') cursor = self.cursor() - cursor.set_key(key); + cursor.set_key(key) cursor.set_value(value) cursor.insert() cursor.close() @@ -77,7 +77,7 @@ class test_base04(wttest.WiredTigerTestCase): def remove(self, key): self.pr('remove') cursor = self.cursor() - cursor.set_key(key); + cursor.set_key(key) cursor.remove() cursor.close() if self.reconcile: diff --git a/test/suite/test_bug001.py b/test/suite/test_bug001.py index 8a42fe6ecbe..4711203953c 100644 --- a/test/suite/test_bug001.py +++ b/test/suite/test_bug001.py @@ -45,7 +45,7 @@ class test_bug001(wttest.WiredTigerTestCase): cursor.set_key(r) cursor.set_value(0xab) cursor.insert() - r += trailing; + r += trailing cursor.set_key(r + 1) cursor.set_value(0xbb) cursor.insert() diff --git a/test/suite/test_checkpoint01.py b/test/suite/test_checkpoint01.py index e218e8c76af..5f232a0b92c 100644 --- a/test/suite/test_checkpoint01.py +++ b/test/suite/test_checkpoint01.py @@ -377,8 +377,8 @@ class test_checkpoint_empty(wttest.WiredTigerTestCase): cursor.close() cursor = self.session.open_cursor(self.uri, None) - cursor.set_key("key"); - cursor.set_value("value"); + cursor.set_key("key") + cursor.set_value("value") cursor.insert() self.session.checkpoint() @@ -394,8 +394,8 @@ class test_checkpoint_empty(wttest.WiredTigerTestCase): cursor.close() cursor = self.session.open_cursor(self.uri, None) - cursor.set_key("key"); - cursor.set_value("value"); + cursor.set_key("key") + cursor.set_value("value") cursor.insert() self.session.checkpoint('name=ckpt') diff --git a/test/suite/test_compact.py b/test/suite/test_compact.py index c05ad088be0..296867f3fea 100644 --- a/test/suite/test_compact.py +++ b/test/suite/test_compact.py @@ -75,7 +75,7 @@ class test_compact(wttest.WiredTigerTestCase, suite_subprocess): # Compact it, using either the session method or the utility. if self.utility == 1: self.session.checkpoint(None) - self.close_conn(); + self.close_conn() self.runWt(["compact", uri]) else: # Optionally reopen the connection so we do more on-disk tests. diff --git a/test/suite/test_compress01.py b/test/suite/test_compress01.py index 84f57c66b3c..f5fc857424f 100644 --- a/test/suite/test_compress01.py +++ b/test/suite/test_compress01.py @@ -25,124 +25,86 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # -# test001.py -# Basic operations +# test_compress01.py +# Basic compression operations # -import os +import os, run import wiredtiger, wttest +from wtscenario import multiply_scenarios, number_scenarios + +# Test basic compression +class test_compress01(wttest.WiredTigerTestCase): + + types = [ + ('file', dict(uri='file:test_compress01')), + ('table', dict(uri='table:test_compress01')), + ] + compress = [ + ('bzip2', dict(compress='bzip2')), + ('nop', dict(compress='nop')), + ('snappy', dict(compress='snappy')), + ('none', dict(compress=None)), + ] + scenarios = number_scenarios(multiply_scenarios('.', types, compress)) -class test_compress01_base(wttest.WiredTigerTestCase): - """ - Test basic compression - """ nrecords = 10000 + bigvalue = "abcdefghij" * 1000 - # running tests from the base class uses no compressor, - # a reasonable way to test the test case. - def __init__(self, testname, compressor_name=None, abbrev='none'): - wttest.WiredTigerTestCase.__init__(self, testname) - self.compressor_name = compressor_name - self.table_name1 = 'test_compress01' + abbrev + '.wt' - # bigvalue = '1234567891011121314....' - self.bigvalue = ''.join([`num` for num in xrange(1,10000)]) # about 38K chars long - - def create_table(self, tablename): - extra_params = ',internal_page_max=16384,leaf_page_max=131072' - comp_params = '' - if self.compressor_name != None: - comp_params = ',block_compressor=' + self.compressor_name - params = 'key_format=S,value_format=S' + extra_params + comp_params - self.pr('create_table: ' + tablename + ', params: ' + params) - self.session.create('file:' + tablename, params) - - def cursor_s(self, tablename, key): - cursor = self.session.open_cursor('file:' + tablename, None) - cursor.set_key(key) - return cursor - - def cursor_ss(self, tablename, key, val): - cursor = self.cursor_s(tablename, key) - cursor.set_value(val) - return cursor - - def record_count(self): - return self.nrecords - - def do_insert(self): - """ - Create a table, add keys with big values, get them back - """ - self.create_table(self.table_name1) - - self.pr("inserting `len(self.bigvalue)` byte values") - for idx in xrange(1,self.record_count()): - val = `idx` + self.bigvalue + `idx` - inscursor = self.cursor_ss(self.table_name1, 'key' + `idx`, val) - inscursor.insert() - inscursor.close() - - def do_verify(self): - self.pr('search') - for idx in xrange(1,self.record_count()): - val = `idx` + self.bigvalue + `idx` - getcursor = self.cursor_s(self.table_name1, 'key' + `idx`) - ret = getcursor.search() - self.assertTrue(ret == 0) - self.assertEquals(getcursor.get_value(), val) - getcursor.close() - - def extensionArg(self, name): - if name != None: - testdir = os.path.dirname(__file__) - import run - extdir = os.path.join(run.wt_builddir, 'ext/compressors') - extfile = os.path.join( - extdir, name, '.libs', 'libwiredtiger_' + name + '.so') - if not os.path.exists(extfile): - self.skipTest('Extension "' + extfile + '" not built') - return 'extensions=["' + extfile + '"]' - else: - return '' - - # override WiredTigerTestCase + # Override WiredTigerTestCase, we have extensions. def setUpConnectionOpen(self, dir): - return self.setUpConnectionWithExtension(dir, self.compressor_name) - - def setUpConnectionWithExtension(self, dir, name): - conn = wiredtiger.wiredtiger_open( - dir, 'create,' + self.extensionArg(name)) + conn = wiredtiger.wiredtiger_open( dir, 'create,' + + ('error_prefix="%s: ",' % self.shortid()) + + self.extensionArg(self.compress)) self.pr(`conn`) return conn + # Return the wiredtiger_open extension argument for a shared library. + def extensionArg(self, name): + if name == None: + return '' -# Put the tests in a class that doesn't inherit from unittest.TestCase so -# they will only be called by the concrete subclasses with real implementations. -# -# It doesn't make sense to call test_compress01_base.test_insert_and_verify -- -# this is how to avoid that. -class compress01_tests(object): - def test_insert_and_verify(self): - self.do_insert() - # We want a fresh cache so compressed pages are read from disk. + testdir = os.path.dirname(__file__) + extdir = os.path.join(run.wt_builddir, 'ext/compressors') + extfile = os.path.join( + extdir, name, '.libs', 'libwiredtiger_' + name + '.so') + if not os.path.exists(extfile): + self.skipTest('compression extension "' + extfile + '" not built') + return ',extensions=["' + extfile + '"]' + + # Create a table, add keys with both big and small values, then verify them. + def test_compress(self): + + # Use relatively small leaf pages to force big values to be overflow + # items, but still large enough that we get some compression action. + params = 'key_format=S,value_format=S,leaf_page_max=4096' + if self.compress != None: + params += ',block_compressor=' + self.compress + + self.session.create(self.uri, params) + cursor = self.session.open_cursor(self.uri, None) + for idx in xrange(1,self.nrecords): + cursor.set_key(`idx`) + if idx / 12 == 0: + cursor.set_value(`idx` + self.bigvalue) + else: + cursor.set_value(`idx` + "abcdefg") + cursor.insert() + cursor.close() + + # Force the cache to disk, so we read compressed pages from disk. self.reopen_conn() - self.do_verify() - - -class test_compress01_1_nop(test_compress01_base, compress01_tests): - def __init__(self, testname): - test_compress01_base.__init__(self, testname, 'nop', 'nop') - -class test_compress01_2_bz(test_compress01_base, compress01_tests): - def __init__(self, testname): - test_compress01_base.__init__(self, testname, 'bzip2', 'bz') -class test_compress01_3_sn(test_compress01_base, compress01_tests): - def __init__(self, testname): - test_compress01_base.__init__(self, testname, 'snappy', 'sn') + cursor = self.session.open_cursor(self.uri, None) + for idx in xrange(1,self.nrecords): + cursor.set_key(`idx`) + self.assertEqual(cursor.search(), 0) + if idx / 12 == 0: + self.assertEquals(cursor.get_value(), `idx` + self.bigvalue) + else: + self.assertEquals(cursor.get_value(), `idx` + "abcdefg") + cursor.close() if __name__ == '__main__': - wttest.run(test_compress01_1_nop) - wttest.run(test_compress01_2_bz) - wttest.run(test_compress01_3_sn) + wttest.run() diff --git a/test/suite/test_config03.py b/test/suite/test_config03.py index 8e1a2007a4b..5fd44c2d3ef 100644 --- a/test/suite/test_config03.py +++ b/test/suite/test_config03.py @@ -113,7 +113,7 @@ class test_config03(test_base03.test_base03): # we know that trigger >= 1 repfrom = ',eviction_target=' + str(self.s_eviction_target) repto = ',eviction_target=' + str(self.s_eviction_trigger - 1) - successargs = successargs.replace(repfrom, repto); + successargs = successargs.replace(repfrom, repto) expect_fail = True if expect_fail: diff --git a/test/suite/test_empty.py b/test/suite/test_empty.py index ee7a4e884b3..bd83d3fbc1d 100644 --- a/test/suite/test_empty.py +++ b/test/suite/test_empty.py @@ -45,7 +45,7 @@ class test_empty(wttest.WiredTigerTestCase): def test_empty_create(self): uri = self.type + self.name self.session.create(uri, 'key_format=' + self.fmt) - self.session.close(); + self.session.close() name = self.name if self.type == "table:": name = name + '.wt' @@ -62,20 +62,20 @@ class test_empty(wttest.WiredTigerTestCase): # Add a few records to the object and remove them. cursor = self.session.open_cursor(uri, None, None) for i in range(1,5): - cursor.set_key(key_populate(cursor, i)); - cursor.set_value("XXX"); - cursor.insert(); - cursor.remove(); + cursor.set_key(key_populate(cursor, i)) + cursor.set_value("XXX") + cursor.insert() + cursor.remove() # Perform a checkpoint (we shouldn't write any underlying pages because # of a checkpoint, either). - self.session.checkpoint("name=ckpt"); + self.session.checkpoint("name=ckpt") # Open and close a checkpoint cursor. cursor = self.session.open_cursor(uri, None, "checkpoint=ckpt") cursor.close() - self.session.close(); + self.session.close() # The file should not have grown. name = self.name diff --git a/test/suite/test_index01.py b/test/suite/test_index01.py index 57750ca2b15..b7eb7586f55 100644 --- a/test/suite/test_index01.py +++ b/test/suite/test_index01.py @@ -86,7 +86,7 @@ class test_index01(wttest.WiredTigerTestCase): def insert(self, *cols): self.pr('insert') cursor = self.cursor() - cursor.set_key(*cols[:2]); + cursor.set_key(*cols[:2]) cursor.set_value(*cols[2:]) self.assertEqual(cursor.insert(), 0) cursor.close() @@ -94,7 +94,7 @@ class test_index01(wttest.WiredTigerTestCase): def insert_overwrite(self, *cols): self.pr('insert') cursor = self.cursor(config='overwrite') - cursor.set_key(*cols[:2]); + cursor.set_key(*cols[:2]) cursor.set_value(*cols[2:]) self.assertEqual(cursor.insert(), 0) cursor.close() @@ -102,7 +102,7 @@ class test_index01(wttest.WiredTigerTestCase): def update(self, *cols): self.pr('update') cursor = self.cursor() - cursor.set_key(*cols[:2]); + cursor.set_key(*cols[:2]) cursor.set_value(*cols[2:]) self.assertEqual(cursor.update(), 0) cursor.close() @@ -110,7 +110,7 @@ class test_index01(wttest.WiredTigerTestCase): def update_nonexistent(self, *cols): self.pr('update') cursor = self.cursor() - cursor.set_key(*cols[:2]); + cursor.set_key(*cols[:2]) cursor.set_value(*cols[2:]) self.assertEqual(cursor.update(), wiredtiger.WT_NOTFOUND) cursor.close() @@ -118,7 +118,7 @@ class test_index01(wttest.WiredTigerTestCase): def remove(self, name, ID): self.pr('remove') cursor = self.cursor() - cursor.set_key(name, ID); + cursor.set_key(name, ID) self.assertEqual(cursor.remove(), 0) cursor.close() diff --git a/test/suite/test_nocache.py b/test/suite/test_nocache.py index f63e435662c..55d6e42dd84 100644 --- a/test/suite/test_nocache.py +++ b/test/suite/test_nocache.py @@ -58,7 +58,7 @@ class test_no_cache(wttest.WiredTigerTestCase): for key,val in cursor: i += 1 if i > 2000: - break; + break self.assertEqual(key, key_populate(cursor, i)) self.assertEqual(val, value_populate(cursor, i)) cursor.close() diff --git a/test/suite/test_overwrite.py b/test/suite/test_overwrite.py index 073615d8345..f8f82bcd936 100644 --- a/test/suite/test_overwrite.py +++ b/test/suite/test_overwrite.py @@ -60,7 +60,7 @@ class test_overwrite(wttest.WiredTigerTestCase): self.assertRaises(wiredtiger.WiredTigerError, lambda: cursor.insert()) cursor.set_key(key_populate(cursor, 10)) - dupc = self.session.open_cursor(None, cursor, "overwrite"); + dupc = self.session.open_cursor(None, cursor, "overwrite") dupc.set_value('XXXXXXXXXX') dupc.insert() diff --git a/test/suite/test_schema03.py b/test/suite/test_schema03.py index dd66e3f4e0d..17a2fb1d06e 100644 --- a/test/suite/test_schema03.py +++ b/test/suite/test_schema03.py @@ -405,7 +405,7 @@ class test_schema03(wttest.WiredTigerTestCase): # colgroups named 'g0' --> 'g<N>' # indices named 'i0' --> 'i<N>' - config = ""; + config = "" config += "key_format=" + tc.keyformats config += ",value_format=" + tc.valueformats config += ",columns=(" diff --git a/test/suite/test_truncate01.py b/test/suite/test_truncate01.py index e2ceea429e0..79c741b3c9e 100644 --- a/test/suite/test_truncate01.py +++ b/test/suite/test_truncate01.py @@ -355,7 +355,7 @@ class test_truncate_cursor(wttest.WiredTigerTestCase): # Optionally insert initial skipped records. cursor = self.session.open_cursor(uri, None, "overwrite") - start = 0; + start = 0 for i in range(0, begin_skipped): start += 1 k = key_populate(cursor, start) diff --git a/test/suite/test_txn02.py b/test/suite/test_txn02.py index a9045764504..a3f370aa790 100644 --- a/test/suite/test_txn02.py +++ b/test/suite/test_txn02.py @@ -104,7 +104,7 @@ class test_txn02(wttest.WiredTigerTestCase): # Transactions see their own changes. # Read-uncommitted transactions see all changes. # Snapshot and read-committed transactions should not see changes. - self.check(self.session, None, current); + self.check(self.session, None, current) self.check(self.session2, "isolation=snapshot", committed) self.check(self.session2, "isolation=read-committed", committed) self.check(self.session2, "isolation=read-uncommitted", current) @@ -135,7 +135,7 @@ class test_txn02(wttest.WiredTigerTestCase): c.set_key(k) c.set_value(i + 2) c.insert() - current[k] = i + 2; + current[k] = i + 2 elif op == 'remove': c.set_key(k) c.remove() diff --git a/test/suite/wttest.py b/test/suite/wttest.py index 802c95ad461..b75b1a08aa9 100644 --- a/test/suite/wttest.py +++ b/test/suite/wttest.py @@ -262,7 +262,7 @@ class WiredTigerTestCase(unittest.TestCase): self.origcwd = os.getcwd() removeAll(self.testdir) if os.path.exists(self.testdir): - raise Exception(self.testdir + ": cannot remove directory"); + raise Exception(self.testdir + ": cannot remove directory") os.makedirs(self.testdir) try: os.chdir(self.testdir) diff --git a/test/suite/wtthread.py b/test/suite/wtthread.py index 92d1b60105b..ec12347c315 100644 --- a/test/suite/wtthread.py +++ b/test/suite/wtthread.py @@ -63,7 +63,7 @@ class backup_thread(threading.Thread): while True: ret = cursor.next() if ret != 0: - break; + break files.append(cursor.get_key()) shutil.copy(cursor.get_key(), self.backup_dir) @@ -75,7 +75,7 @@ class backup_thread(threading.Thread): uris = list() for next_file in files: if next_file.startswith("WiredTiger"): - continue; + continue uri = "file:" + next_file uris.append(uri) |