diff options
author | Luke Chen <luke.chen@mongodb.com> | 2019-10-03 05:44:38 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-03 05:44:38 +0000 |
commit | 0d0748ae6896c7ab235dffb2a0c8a49e16fad7f8 (patch) | |
tree | 9fcbf110eaa9ef3148ac8e64f72a38aafdf878c8 /src/third_party/wiredtiger/test | |
parent | 2961e15b5fd4534b324d78557afcf795aba056b6 (diff) | |
download | mongo-0d0748ae6896c7ab235dffb2a0c8a49e16fad7f8.tar.gz |
Import wiredtiger: e0041ca53c1c1a4a23cc7aaa7ef8137dc1c61117 from branch mongodb-4.4
ref: 0cd668bf3a..e0041ca53c
for: 4.3.1
WT-4702 Switch to ubuntu1804-test Evergreen distro
WT-4715 Workloads will stall if old transaction or timestamp pinned by thread co-opted for eviction
WT-4961 Checkpoints with cache overflow must keep history for reads
WT-5093 Enable million-collection-test working with Evergreen distro rhel80-build
WT-5094 Enable Windows compile task working with Evergreen distro windows-64-vs2017-test
WT-5122 Shut down the sweep server before doing the final checkpoint
WT-5128 Add script to run wtperf with XRay profiling
WT-5130 Enable Big-endian (s390x/zSeries) working with Evergreen distro ubuntu1804-zseries-build
WT-5135 Change lookaside file inserts to use cursor.insert
WT-5140 Fix where a cursor returning random items can use an uninitialized buffer
WT-5143 Fix typo in error message
Diffstat (limited to 'src/third_party/wiredtiger/test')
14 files changed, 203 insertions, 47 deletions
diff --git a/src/third_party/wiredtiger/test/evergreen.yml b/src/third_party/wiredtiger/test/evergreen.yml index bf20d7568bc..c6131ac0e77 100755 --- a/src/third_party/wiredtiger/test/evergreen.yml +++ b/src/third_party/wiredtiger/test/evergreen.yml @@ -54,7 +54,8 @@ functions: set -o errexit set -o verbose if [ "Windows_NT" = "$OS" ]; then - scons.bat --enable-python=c:\\swigwin-3.0.2\\swig.exe --enable-diagnostic ${smp_command|} + pip install scons==3.1.1 + scons-3.1.1.bat --enable-python=c:\\swigwin-3.0.2\\swig.exe --enable-diagnostic ${smp_command|} else cd build_posix sh ./reconf @@ -991,7 +992,8 @@ tasks: set -o errexit set -o verbose - scons.bat ${smp_command|} "CFLAGS=/Gv /wd4090 /wd4996 /we4047 /we4024 /TC /we4100 /we4133" wiredtiger.dll libwiredtiger.lib + pip install scons==3.1.1 + scons-3.1.1.bat ${smp_command|} "CFLAGS=/Gv /wd4090 /wd4996 /we4047 /we4024 /TC /we4100 /we4133" wiredtiger.dll libwiredtiger.lib - name: fops depends_on: @@ -1025,9 +1027,6 @@ tasks: cmd.exe /c "cd test\\format && ..\\..\\t_format.exe reverse=0 encryption=none logging_compression=none runs=20" - name: million-collection-test - depends_on: [] - run_on: - - rhel62-large commands: - func: "fetch source" - func: "fetch mongo-tests repo" @@ -1035,6 +1034,7 @@ tasks: params: working_dir: mongo-tests script: | + sudo su set -o errexit set -o verbose ulimit -n 1000000 @@ -1176,10 +1176,10 @@ tasks: buildvariants: -- name: ubuntu1404 - display_name: Ubuntu 14.04 +- name: ubuntu1804 + display_name: Ubuntu 18.04 run_on: - - ubuntu1404-test + - ubuntu1804-test expansions: # It's ugly, but we need the absolute path here, not the relative test_env_vars: PATH=/opt/mongodbtoolchain/v3/bin:$PATH LD_LIBRARY_PATH=$(pwd)/.libs top_srcdir=$(pwd)/.. top_builddir=$(pwd) @@ -1244,10 +1244,10 @@ buildvariants: - name: unit-test-bucket07 - name: fops -- name: ubuntu1404-python3 - display_name: Ubuntu 14.04 (Python3) +- name: ubuntu1804-python3 + display_name: Ubuntu 18.04 (Python3) run_on: - - ubuntu1404-test + - ubuntu1804-test expansions: test_env_vars: PATH=/opt/mongodbtoolchain/v3/bin:$PATH LD_LIBRARY_PATH=$(pwd)/.libs top_srcdir=$(pwd)/.. top_builddir=$(pwd) smp_command: -j $(grep -c ^processor /proc/cpuinfo) @@ -1270,7 +1270,7 @@ buildvariants: display_name: Large scale testing batchtime: 1440 # 1 day run_on: - - rhel62-large + - rhel80-build expansions: configure_env_vars: CC=/opt/mongodbtoolchain/v3/bin/gcc CXX=/opt/mongodbtoolchain/v3/bin/g++ tasks: @@ -1280,14 +1280,14 @@ buildvariants: display_name: Compatibility tests batchtime: 10080 # 7 days run_on: - - ubuntu1404-test + - ubuntu1804-test tasks: - name: compatibility-test-for-mongodb-releases - name: windows-64 display_name: Windows 64-bit run_on: - - windows-64-vs2013-test + - windows-64-vs2017-test tasks: - name: compile - name: compile-windows-alt @@ -1337,7 +1337,7 @@ buildvariants: modules: - enterprise run_on: - - ubuntu1604-zseries-small + - ubuntu1804-zseries-build batchtime: 10080 # 7 days expansions: smp_command: -j $(grep -c ^processor /proc/cpuinfo) diff --git a/src/third_party/wiredtiger/test/format/Makefile.am b/src/third_party/wiredtiger/test/format/Makefile.am index da55ffece4c..2d9bbf21eb8 100644 --- a/src/third_party/wiredtiger/test/format/Makefile.am +++ b/src/third_party/wiredtiger/test/format/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS +=-I$(top_srcdir)/test/utility noinst_PROGRAMS = t t_SOURCES =\ - backup.c bulk.c compact.c config.c lrt.c ops.c rebalance.c \ + backup.c bulk.c compact.c config.c lrt.c ops.c random.c rebalance.c \ salvage.c snap.c t.c util.c wts.c t_LDADD = $(top_builddir)/test/utility/libtest_util.la diff --git a/src/third_party/wiredtiger/test/format/config.h b/src/third_party/wiredtiger/test/format/config.h index 58decce75af..492d5124a1c 100644 --- a/src/third_party/wiredtiger/test/format/config.h +++ b/src/third_party/wiredtiger/test/format/config.h @@ -222,6 +222,9 @@ static CONFIG c[] = {{"abort", "if timed run should drop core", /* 0% */ {"quiet", "quiet run (same as -q)", C_IGNORE | C_BOOL, 0, 0, 1, &g.c_quiet, NULL}, + {"random_cursor", "if random cursor reads configured", /* 10% */ + C_BOOL, 10, 0, 0, &g.c_random_cursor, NULL}, + {"read_pct", "percent operations that are reads", C_IGNORE, 0, 0, 100, &g.c_read_pct, NULL}, {"rebalance", "rebalance testing", /* 100% */ diff --git a/src/third_party/wiredtiger/test/format/format.h b/src/third_party/wiredtiger/test/format/format.h index e90bbf86998..890f03c845c 100644 --- a/src/third_party/wiredtiger/test/format/format.h +++ b/src/third_party/wiredtiger/test/format/format.h @@ -178,6 +178,7 @@ typedef struct { uint32_t c_prefix_compression_min; uint32_t c_prepare; uint32_t c_quiet; + uint32_t c_random_cursor; uint32_t c_read_pct; uint32_t c_rebalance; uint32_t c_repeat_data_pct; @@ -345,6 +346,7 @@ void key_gen_insert(WT_RAND_STATE *, WT_ITEM *, uint64_t); void key_gen_teardown(WT_ITEM *); void key_init(void); WT_THREAD_RET lrt(void *); +WT_THREAD_RET random_kv(void *); void path_setup(const char *); int read_row_worker(WT_CURSOR *, uint64_t, WT_ITEM *, WT_ITEM *, bool); uint32_t rng(WT_RAND_STATE *); diff --git a/src/third_party/wiredtiger/test/format/ops.c b/src/third_party/wiredtiger/test/format/ops.c index a03b42e427b..6f5e7943c83 100644 --- a/src/third_party/wiredtiger/test/format/ops.c +++ b/src/third_party/wiredtiger/test/format/ops.c @@ -87,7 +87,7 @@ wts_ops(bool lastrun) TINFO *tinfo, total; WT_CONNECTION *conn; WT_SESSION *session; - wt_thread_t alter_tid, backup_tid, checkpoint_tid, compact_tid, lrt_tid; + wt_thread_t alter_tid, backup_tid, checkpoint_tid, compact_tid, lrt_tid, random_tid; wt_thread_t timestamp_tid; int64_t fourths, quit_fourths, thread_ops; uint32_t i; @@ -101,6 +101,7 @@ wts_ops(bool lastrun) memset(&checkpoint_tid, 0, sizeof(checkpoint_tid)); memset(&compact_tid, 0, sizeof(compact_tid)); memset(&lrt_tid, 0, sizeof(lrt_tid)); + memset(&random_tid, 0, sizeof(random_tid)); memset(×tamp_tid, 0, sizeof(timestamp_tid)); modify_repl_init(); @@ -183,6 +184,8 @@ wts_ops(bool lastrun) testutil_check(__wt_thread_create(NULL, &compact_tid, compact, NULL)); if (!SINGLETHREADED && g.c_long_running_txn) testutil_check(__wt_thread_create(NULL, &lrt_tid, lrt, NULL)); + if (g.c_random_cursor) + testutil_check(__wt_thread_create(NULL, &random_tid, random_kv, NULL)); if (g.c_txn_timestamps) testutil_check(__wt_thread_create(NULL, ×tamp_tid, timestamp, tinfo_list)); @@ -267,6 +270,8 @@ wts_ops(bool lastrun) testutil_check(__wt_thread_join(NULL, &compact_tid)); if (!SINGLETHREADED && g.c_long_running_txn) testutil_check(__wt_thread_join(NULL, &lrt_tid)); + if (g.c_random_cursor) + testutil_check(__wt_thread_join(NULL, &random_tid)); if (g.c_txn_timestamps) testutil_check(__wt_thread_join(NULL, ×tamp_tid)); g.workers_finished = false; diff --git a/src/third_party/wiredtiger/test/format/random.c b/src/third_party/wiredtiger/test/format/random.c new file mode 100644 index 00000000000..131cb0bd258 --- /dev/null +++ b/src/third_party/wiredtiger/test/format/random.c @@ -0,0 +1,95 @@ +/*- + * Public Domain 2014-2019 MongoDB, Inc. + * Public Domain 2008-2014 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. + */ + +#include "format.h" + +/* + * random_kv -- + * Do random cursor operations. + */ +WT_THREAD_RET +random_kv(void *arg) +{ + WT_CONNECTION *conn; + WT_CURSOR *cursor; + WT_DECL_RET; + WT_ITEM key, value; + WT_SESSION *session; + uint32_t i; + u_int period; + const char *config; + bool simple; + + (void)(arg); /* Unused parameter */ + + conn = g.wts_conn; + + /* Random cursor ops are only supported on row-store. */ + if (g.type != ROW) + return (WT_THREAD_RET_VALUE); + + /* Open a session. */ + testutil_check(conn->open_session(conn, NULL, NULL, &session)); + + for (simple = false;;) { + /* Alternate between simple random cursors and sample-size random cursors. */ + config = simple ? "next_random=true" : "next_random=true,next_random_sample_size=37"; + simple = !simple; + + /* + * open_cursor can return EBUSY if concurrent with a metadata operation, retry in that case. + */ + while ((ret = session->open_cursor(session, g.uri, NULL, config, &cursor)) == EBUSY) + __wt_yield(); + testutil_check(ret); + + /* This is just a smoke-test, get some key/value pairs. */ + for (i = mmrand(NULL, 0, 1000); i > 0; --i) { + testutil_check(cursor->next(cursor)); + testutil_check(cursor->get_key(cursor, &key)); + testutil_check(cursor->get_value(cursor, &value)); + } + + testutil_check(cursor->close(cursor)); + + /* Sleep for some number of seconds. */ + period = mmrand(NULL, 1, 10); + + /* Sleep for short periods so we don't make the run wait. */ + while (period > 0 && !g.workers_finished) { + --period; + __wt_sleep(1, 0); + } + if (g.workers_finished) + break; + } + + testutil_check(session->close(session, NULL)); + + return (WT_THREAD_RET_VALUE); +} diff --git a/src/third_party/wiredtiger/test/format/wts.c b/src/third_party/wiredtiger/test/format/wts.c index 89a72f090e7..f3482861573 100644 --- a/src/third_party/wiredtiger/test/format/wts.c +++ b/src/third_party/wiredtiger/test/format/wts.c @@ -162,7 +162,8 @@ wts_open(const char *home, bool set_api, WT_CONNECTION **connp) ",cache_size=%" PRIu32 "MB" ",checkpoint_sync=false" - ",error_prefix=\"%s\"", + ",error_prefix=\"%s\"" + ",operation_timeout_ms=2000", g.c_cache, progname); /* In-memory configuration. */ diff --git a/src/third_party/wiredtiger/test/suite/test_debug_mode05.py b/src/third_party/wiredtiger/test/suite/test_debug_mode05.py index f248a05e646..09597e7a38f 100644 --- a/src/third_party/wiredtiger/test/suite/test_debug_mode05.py +++ b/src/third_party/wiredtiger/test/suite/test_debug_mode05.py @@ -43,9 +43,11 @@ class test_debug_mode05(wttest.WiredTigerTestCase): def test_table_logging_rollback_to_stable(self): self.session.create(self.uri, 'key_format=i,value_format=u') + cursor = self.session.open_cursor(self.uri, None) self.conn.set_timestamp('stable_timestamp=' + timestamp_str(100)) + self.session.checkpoint() # Try doing a normal prepared txn and then rollback to stable. self.session.begin_transaction() diff --git a/src/third_party/wiredtiger/test/suite/test_las01.py b/src/third_party/wiredtiger/test/suite/test_las01.py index 76f19b51768..679d01ae06d 100755 --- a/src/third_party/wiredtiger/test/suite/test_las01.py +++ b/src/third_party/wiredtiger/test/suite/test_las01.py @@ -83,10 +83,11 @@ class test_las01(wttest.WiredTigerTestCase): # Skip the initial rows, which were not updated for i in range(0, nrows+1): self.assertEqual(cursor.next(), 0) - if (check_value != cursor.get_value()): - print("Check value : " + str(check_value)) - print("value : " + str(cursor.get_value())) - self.assertTrue(check_value == cursor.get_value()) + if check_value != cursor.get_value(): + session.breakpoint() + self.assertTrue(check_value == cursor.get_value(), + "for key " + str(i) + ", expected " + str(check_value) + + ", got " + str(cursor.get_value())) cursor.close() session.close() conn.close() diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp04.py b/src/third_party/wiredtiger/test/suite/test_timestamp04.py index acbad7e02a4..9e0e4a0cec0 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp04.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp04.py @@ -78,7 +78,8 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess): # Search for the expected items as well as iterating. for k, v in expected.items(): if missing == False: - self.assertEqual(cur[k], v, "for key " + str(k)) + self.assertEqual(cur[k], v, "for key " + str(k) + + " expected " + str(v) + ", got " + str(cur[k])) else: cur.set_key(k) if self.empty: @@ -162,7 +163,11 @@ class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess): # Roll back half timestamps. stable_ts = timestamp_str(key_range // 2) self.conn.set_timestamp('stable_timestamp=' + stable_ts) + + # We're about to test rollback-to-stable which requires a checkpoint to which we can roll back. + self.session.checkpoint() self.conn.rollback_to_stable() + stat_cursor = self.session.open_cursor('statistics:', None, None) calls = stat_cursor[stat.conn.txn_rollback_to_stable][2] upd_aborted = (stat_cursor[stat.conn.txn_rollback_upd_aborted][2] + diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp06.py b/src/third_party/wiredtiger/test/suite/test_timestamp06.py index 55981f67a98..fd004a23703 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp06.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp06.py @@ -157,7 +157,7 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): # Scenario: 1 # Check that we see all the latest values (i.e. 3) as per transaction - # visibility when reading with out the read timestamp. + # visibility when reading without the read timestamp. # All tables should see all the values. self.check(self.session, "", self.table_ts_log, dict((k, 3) for k in orig_keys)) @@ -204,8 +204,12 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): self.ckpt_backup(2, (nkeys - valcnt_ts_log), (nkeys - valcnt_ts_nolog)) # Scenario: 3 - # Check that we see all the data values correctly after rollback + # Check we see all the data values correctly after rollback. Skip the case where the most + # recent checkpoint wasn't based on the last stable timestamp, those can't be rolled back. + if self.ckpt_ts == False: + return self.conn.rollback_to_stable() + # All tables should see the values correctly when read with # read timestamp as stable timestamp. self.check(self.session, 'read_timestamp=' + stable_ts, @@ -214,7 +218,7 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): self.table_ts_log, dict((k, 2) for k in orig_keys)) # Scenario: 4 - # Check that we see the values correctly when read with out any + # Check that we see the values correctly when read without any # timestamp. if self.using_log == True: # For logged table we should see latest values (i.e. 3) when logging @@ -224,21 +228,13 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): else: # When logging is disabled, we should not see the values beyond the # stable timestamp with timestamped checkpoints. - if self.ckpt_ts == True: - self.check(self.session, "", - self.table_ts_log, dict((k, 2) for k in orig_keys)) - else: - self.check(self.session, "", - self.table_ts_log, dict((k, 3) for k in orig_keys)) + self.check(self.session, "", + self.table_ts_log, dict((k, 2) for k in orig_keys)) # For non-logged table we should not see the values beyond the # stable timestamp with timestamped checkpoints. - if self.ckpt_ts == True: - self.check(self.session, "", - self.table_ts_nolog, dict((k, 2) for k in orig_keys)) - else: - self.check(self.session, "", - self.table_ts_nolog, dict((k, 3) for k in orig_keys)) + self.check(self.session, "", + self.table_ts_nolog, dict((k, 2) for k in orig_keys)) if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp11.py b/src/third_party/wiredtiger/test/suite/test_timestamp11.py index 1256a544d78..f3d03cd8fa5 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp11.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp11.py @@ -83,6 +83,7 @@ class test_timestamp11(wttest.WiredTigerTestCase, suite_subprocess): # stable_ts = timestamp_str(2) self.conn.set_timestamp('stable_timestamp=' + stable_ts) + self.session.checkpoint() self.conn.rollback_to_stable() c = self.session.open_cursor(uri) diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp16.py b/src/third_party/wiredtiger/test/suite/test_timestamp16.py index bef116d62a9..20663889450 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp16.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp16.py @@ -50,25 +50,21 @@ class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess): self.session.begin_transaction('read_timestamp=100') self.session.rollback_transaction() self.session.checkpoint('use_timestamp=true') - self.assertTimestampsEqual('0', - self.conn.query_timestamp('get=last_checkpoint')) + self.assertTimestampsEqual('0', self.conn.query_timestamp('get=last_checkpoint')) - # Set a stable and make sure that we still checkpoint at - # the stable. - self.conn.set_timestamp('stable_timestamp=1') + # Set a stable and make sure that we still checkpoint at the stable. + self.conn.set_timestamp('stable_timestamp=2') self.session.begin_transaction('read_timestamp=100') self.session.rollback_transaction() self.session.checkpoint('use_timestamp=true') - self.assertTimestampsEqual('1', - self.conn.query_timestamp('get=last_checkpoint')) + self.assertTimestampsEqual('2', self.conn.query_timestamp('get=last_checkpoint')) # Finally make sure that commit also resets the read timestamp. self.session.create(self.uri, 'key_format=i,value_format=i') self.session.begin_transaction('read_timestamp=150') self.session.commit_transaction() self.session.checkpoint('use_timestamp=true') - self.assertTimestampsEqual('1', - self.conn.query_timestamp('get=last_checkpoint')) + self.assertTimestampsEqual('2', self.conn.query_timestamp('get=last_checkpoint')) if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_txn21.py b/src/third_party/wiredtiger/test/suite/test_txn21.py new file mode 100644 index 00000000000..212a4d321b6 --- /dev/null +++ b/src/third_party/wiredtiger/test/suite/test_txn21.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# +# Public Domain 2014-2019 MongoDB, Inc. +# Public Domain 2008-2014 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. +# +# test_txn21.py +# Transactions: smoke test the operation timeout API +# + +import wiredtiger, wttest + +class test_txn21(wttest.WiredTigerTestCase): + + # Connection-level configuration. + def test_operation_timeout_conn(self): + # Close the automatically opened connection and open one with the timeout configuration. + conn_config = 'operation_timeout_ms=2000' + self.conn.close() + self.conn = wiredtiger.wiredtiger_open(self.home, conn_config) + + # Transaction-level configuration. + def test_operation_timeout_txn(self): + self.session.begin_transaction('operation_timeout_ms=2000') + +if __name__ == '__main__': + wttest.run() |