summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-11-30 12:10:49 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-11-30 12:10:49 +1100
commit923e2881df5ce70afe495f2ef7db39ce86d66747 (patch)
tree7e59e60e19789bb681d46755439ed582bb81163a
parent5e6d8b11a82f043741f305180151515b706f0067 (diff)
parentb0099cb3e9402b99b50889f11f46c14ba424227a (diff)
downloadmongo-923e2881df5ce70afe495f2ef7db39ce86d66747.tar.gz
Merge branch 'develop' into generation
-rw-r--r--dist/s_style6
-rw-r--r--src/schema/schema_create.c3
-rw-r--r--src/utilities/util_dump.c181
-rw-r--r--test/suite/helper.py22
-rw-r--r--test/suite/test_backup.py4
-rw-r--r--test/suite/test_base04.py4
-rw-r--r--test/suite/test_bug001.py2
-rw-r--r--test/suite/test_checkpoint01.py8
-rw-r--r--test/suite/test_checkpoint02.py8
-rw-r--r--test/suite/test_compact.py2
-rw-r--r--test/suite/test_config03.py2
-rw-r--r--test/suite/test_dump.py92
-rw-r--r--test/suite/test_empty.py14
-rw-r--r--test/suite/test_index01.py10
-rw-r--r--test/suite/test_nocache.py2
-rw-r--r--test/suite/test_overwrite.py2
-rw-r--r--test/suite/test_schema03.py2
-rw-r--r--test/suite/test_truncate01.py2
-rw-r--r--test/suite/test_txn02.py4
-rw-r--r--test/suite/wttest.py2
-rw-r--r--test/suite/wtthread.py4
21 files changed, 249 insertions, 127 deletions
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/schema/schema_create.c b/src/schema/schema_create.c
index a514d32346a..82f5437f4c4 100644
--- a/src/schema/schema_create.c
+++ b/src/schema/schema_create.c
@@ -153,7 +153,8 @@ __create_colgroup(WT_SESSION_IMPL *session,
;
/* Add the source to the colgroup config before collapsing. */
- if (__wt_config_getones(session, config, "source", &cval) == 0) {
+ if (__wt_config_getones(
+ session, config, "source", &cval) == 0 && cval.len != 0) {
WT_ERR(__wt_buf_fmt(
session, &namebuf, "%.*s", (int)cval.len, cval.str));
source = namebuf.data;
diff --git a/src/utilities/util_dump.c b/src/utilities/util_dump.c
index 073feb92399..abacccf8093 100644
--- a/src/utilities/util_dump.c
+++ b/src/utilities/util_dump.c
@@ -11,6 +11,8 @@ static int dump_config(WT_SESSION *, const char *, int);
static int dump_prefix(int);
static int dump_suffix(void);
static int dump_table_config(WT_SESSION *, WT_CURSOR *, const char *);
+static int dump_table_config_type(WT_SESSION *,
+ WT_CURSOR *, WT_CURSOR *, const char *, const char *, const char *);
static int print_config(WT_SESSION *, const char *, const char *, const char *);
static int usage(void);
@@ -130,7 +132,7 @@ err: ret = 1;
}
/*
- * config --
+ * dump_config --
* Dump the config for the uri.
*/
static int
@@ -168,8 +170,11 @@ dump_config(WT_SESSION *session, const char *uri, int hex)
else
ret = util_err(ret, "%s", uri);
- if (cursor != NULL && (tret = cursor->close(cursor)) != 0)
- ret = util_cerr(uri, "close", tret);
+ if ((tret = cursor->close(cursor)) != 0) {
+ tret = util_cerr(uri, "close", tret);
+ if (ret == 0)
+ ret = tret;
+ }
} else {
/*
* We want to be able to dump the metadata file itself, but the
@@ -201,59 +206,18 @@ dump_config(WT_SESSION *session, const char *uri, int hex)
static int
dump_table_config(WT_SESSION *session, WT_CURSOR *cursor, const char *uri)
{
- struct {
- char *key; /* Metadata key */
- char *value; /* Metadata value */
- } *list;
+ WT_CURSOR *srch;
WT_DECL_RET;
- int i, elem, list_elem;
+ int tret;
const char *key, *name, *value;
- char *buf, *filename, *p, *t, *sep;
- /* Get the name. */
+ /* Get the table name. */
if ((name = strchr(uri, ':')) == NULL) {
fprintf(stderr, "%s: %s: corrupted uri\n", progname, uri);
return (1);
}
++name;
- list = NULL;
- elem = list_elem = 0;
- for (; (ret = cursor->next(cursor)) == 0; free(buf)) {
- /* Get the key and duplicate it, we want to overwrite it. */
- if ((ret = cursor->get_key(cursor, &key)) != 0)
- return (util_cerr(uri, "get_key", ret));
- if ((buf = strdup(key)) == NULL)
- return (util_err(errno, NULL));
-
- /* Check for the dump table's column groups or indices. */
- if ((p = strchr(buf, ':')) == NULL)
- continue;
- *p++ = '\0';
- if (strcmp(buf, "index") != 0 && strcmp(buf, "colgroup") != 0)
- continue;
- if ((t = strchr(p, ':')) == NULL)
- continue;
- *t++ = '\0';
- if (strcmp(p, name) != 0)
- continue;
-
- /* Found one, save it for review. */
- if ((ret = cursor->get_value(cursor, &value)) != 0)
- return (util_cerr(uri, "get_value", ret));
- if (elem == list_elem && (list = realloc(list,
- (size_t)(list_elem += 20) * sizeof(*list))) == NULL)
- return (util_err(errno, NULL));
- if ((list[elem].key = strdup(key)) == NULL)
- return (util_err(errno, NULL));
- if ((list[elem].value = strdup(value)) == NULL)
- return (util_err(errno, NULL));
- ++elem;
- }
- if (ret != WT_NOTFOUND)
- return (util_cerr(uri, "next", ret));
- ret = 0;
-
/*
* Dump out the config information: first, dump the uri entry itself
* (requires a lookup).
@@ -269,53 +233,104 @@ dump_table_config(WT_SESSION *session, WT_CURSOR *cursor, const char *uri)
return (1);
/*
- * Second, dump the column group and index key/value pairs: for each
- * one, look up the related file information and append it to the base
- * record.
+ * The underlying table configuration function needs a second cursor:
+ * open one before calling it, it makes error handling hugely simpler.
*/
- for (i = 0; i < elem; ++i) {
- if ((filename = strstr(list[i].value, "filename=")) == NULL) {
- fprintf(stderr,
- "%s: %s: has no underlying file configuration\n",
- progname, list[i].key);
- return (1);
- }
+ if ((ret =
+ session->open_cursor(session, NULL, cursor, NULL, &srch)) != 0)
+ return (util_cerr(uri, "open_cursor", ret));
+
+ if ((ret = dump_table_config_type(
+ session, cursor, srch, uri, name, "colgroup:")) == 0)
+ ret = dump_table_config_type(
+ session, cursor, srch, uri, name, "index:");
+
+ if ((tret = srch->close(srch)) != 0) {
+ tret = util_cerr(uri, "close", tret);
+ if (ret == 0)
+ ret = tret;
+ }
- /*
- * Nul-terminate the filename if necessary, create the file
- * URI, then look it up.
- */
- if ((sep = strchr(filename, ',')) != NULL)
- *sep = '\0';
- if ((t = strdup(filename)) == NULL)
+ return (ret);
+}
+
+/*
+ * dump_table_config_type --
+ * Dump the column groups or indices for a table.
+ */
+static int
+dump_table_config_type(WT_SESSION *session,
+ WT_CURSOR *cursor, WT_CURSOR *srch,
+ const char *uri, const char *name, const char *entry)
+{
+ WT_CONFIG_ITEM cval;
+ WT_DECL_RET;
+ const char *key, *skip, *value, *value_source;
+ int exact;
+ char *p;
+
+ /*
+ * Search the file looking for column group and index key/value pairs:
+ * for each one, look up the related source information and append it
+ * to the base record.
+ */
+ cursor->set_key(cursor, entry);
+ if ((ret = cursor->search_near(cursor, &exact)) != 0) {
+ if (ret == WT_NOTFOUND)
+ return (0);
+ return (util_cerr(uri, "search_near", ret));
+ }
+ if (exact >= 0)
+ goto match;
+ while ((ret = cursor->next(cursor)) == 0) {
+match: if ((ret = cursor->get_key(cursor, &key)) != 0)
+ return (util_cerr(uri, "get_key", ret));
+
+ /* Check if we've finished the list of entries. */
+ if (!WT_PREFIX_MATCH(key, entry))
+ return (0);
+
+ /* Check for a table name match. */
+ skip = key + strlen(entry);
+ if (strncmp(
+ skip, name, strlen(name)) != 0 || skip[strlen(name)] != ':')
+ continue;
+
+ /* Get the value. */
+ if ((ret = cursor->get_value(cursor, &value)) != 0)
+ return (util_cerr(uri, "get_value", ret));
+
+ /* Crack it and get the underlying source. */
+ if ((ret = __wt_config_getones(
+ (WT_SESSION_IMPL *)session, value, "source", &cval)) != 0)
+ return (util_err(ret, "%s: source entry", key));
+
+ /* Nul-terminate the source entry. */
+ if ((p = malloc(cval.len + 10)) == NULL)
return (util_err(errno, NULL));
- if (sep != NULL)
- *sep = ',';
- p = t + strlen("filename=");
- p -= strlen("file:");
- memcpy(p, "file:", strlen("file:"));
- cursor->set_key(cursor, p);
- if ((ret = cursor->search(cursor)) != 0) {
- fprintf(stderr,
- "%s: %s: unable to find metadata for the "
- "underlying file %s\n",
- progname, list[i].key, p);
+ (void)strncpy(p, cval.str, cval.len);
+ p[cval.len] = '\0';
+ srch->set_key(srch, p);
+ if ((ret = srch->search(srch)) != 0)
+ ret = util_err(ret, "%s: %s", key, p);
+ free(p);
+ if (ret != 0)
return (1);
- }
- if ((ret = cursor->get_value(cursor, &value)) != 0)
+
+ /* Get the source's value. */
+ if ((ret = srch->get_value(srch, &value_source)) != 0)
return (util_cerr(uri, "get_value", ret));
/*
* The dumped configuration string is the original key plus the
- * file's configuration.
+ * source's configuration.
*/
- if (print_config(
- session, list[i].key, list[i].value, value) != 0)
+ if (print_config(session, key, value, value_source) != 0)
return (util_err(EIO, NULL));
}
-
- /* Leak the memory, I don't care. */
- return (0);
+ if (ret == 0 || ret == WT_NOTFOUND)
+ return (0);
+ return (util_cerr(uri, "next", ret));
}
/*
diff --git a/test/suite/helper.py b/test/suite/helper.py
index 1a7f9216c85..1fb28024392 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:
@@ -137,16 +137,19 @@ def simple_populate(self, uri, config, rows):
cursor.insert()
cursor.close()
-def simple_populate_check(self, uri):
- self.pr('simple_populate_check: ' + uri)
- cursor = self.session.open_cursor(uri, None)
+def simple_populate_check_cursor(self, cursor):
i = 0
for key,val in cursor:
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))
+
+def simple_populate_check(self, uri):
+ self.pr('simple_populate_check: ' + uri)
+ cursor = self.session.open_cursor(uri, None)
+ simple_populate_check_cursor(self, cursor)
cursor.close()
# Return the value stored in a complex object.
@@ -190,9 +193,7 @@ def complex_populate(self, uri, config, rows):
cursor.insert()
cursor.close()
-def complex_populate_check(self, uri):
- self.pr('complex_populate_check: ' + uri)
- cursor = self.session.open_cursor(uri, None)
+def complex_populate_check_cursor(self, cursor):
i = 0
for key, s1, i2, s3, s4 in cursor:
i += 1
@@ -202,4 +203,9 @@ def complex_populate_check(self, uri):
self.assertEqual(i2, v[1])
self.assertEqual(s3, v[2])
self.assertEqual(s4, v[3])
+
+def complex_populate_check(self, uri):
+ self.pr('complex_populate_check: ' + uri)
+ cursor = self.session.open_cursor(uri, None)
+ complex_populate_check_cursor(self, cursor)
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_checkpoint02.py b/test/suite/test_checkpoint02.py
index 73999517e63..bff10ff65e0 100644
--- a/test/suite/test_checkpoint02.py
+++ b/test/suite/test_checkpoint02.py
@@ -56,15 +56,17 @@ class test_checkpoint02(wttest.WiredTigerTestCase):
queue.put_nowait(('b', i, my_data))
queue.put_nowait(('i', i, my_data))
+ opthreads = []
for i in xrange(self.nthreads):
t = op_thread(self.conn, uris, self.fmt, queue, done)
+ opthreads.append(t)
t.start()
queue.join()
done.set()
- # Wait for checkpoint thread to notice status change.
- while ckpt.is_alive():
- time.sleep(0.01)
+ for t in opthreads:
+ t.join()
+ ckpt.join()
# Create a cursor - ensure all items have been put.
cursor = self.session.open_cursor(self.uri, None, None)
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_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_dump.py b/test/suite/test_dump.py
new file mode 100644
index 00000000000..b6aef26ec1f
--- /dev/null
+++ b/test/suite/test_dump.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+#
+# Public Domain 2008-2012 WiredTiger, Inc.
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+import os
+import wiredtiger, wttest
+from helper import \
+ complex_populate, complex_populate_check_cursor,\
+ simple_populate, simple_populate_check_cursor
+from suite_subprocess import suite_subprocess
+from wtscenario import multiply_scenarios, number_scenarios
+
+# test_dump.py
+# Utilities: wt dump
+# Test the dump utility (I'm not testing the dump cursors, that's what the
+# utility uses underneath).
+class test_dump(wttest.WiredTigerTestCase, suite_subprocess):
+ dir='dump.dir' # Backup directory name
+
+ name = 'test_dump'
+ nentries = 2500
+
+ dumpfmt = [
+ ('hex', dict(hex=1)),
+ ('txt', dict(hex=0))
+ ]
+ keyfmt = [
+ ('integer', dict(keyfmt='i')),
+ ('recno', dict(keyfmt='r')),
+ ('string', dict(keyfmt='S'))
+ ]
+ types = [
+ ('file', dict(type='file:',
+ populate=simple_populate,
+ populate_check=simple_populate_check_cursor)),
+ ('table-simple', dict(type='table:',
+ populate=simple_populate,
+ populate_check=simple_populate_check_cursor)),
+ ('table-complex', dict(type='table:',
+ populate=complex_populate,
+ populate_check=complex_populate_check_cursor))
+ ]
+ scenarios = number_scenarios(
+ multiply_scenarios('.', types, keyfmt, dumpfmt))
+
+ # Dump, re-load and do a content comparison.
+ def test_dump(self):
+ # Create the object.
+ uri = self.type + self.name
+ self.populate(self, uri, 'key_format=' + self.keyfmt, self.nentries)
+
+ # Dump and re-load the object.
+ os.mkdir(self.dir)
+ if self.hex == 1:
+ self.runWt(['dump', '-x', uri], outfilename='dump.out')
+ else:
+ self.runWt(['dump', uri], outfilename='dump.out')
+ self.runWt(['-h', self.dir, 'load', '-f', 'dump.out'])
+
+ # Check the loaded contents are correct.
+ conn = wiredtiger.wiredtiger_open(self.dir)
+ session = conn.open_session()
+ cursor = session.open_cursor(uri, None, None)
+ self.populate_check(self, cursor)
+ conn.close()
+
+
+if __name__ == '__main__':
+ wttest.run()
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)