summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct8
-rw-r--r--dist/s_string.ok1
-rw-r--r--ext/compressors/lz4/lz4_compress.c14
-rw-r--r--lang/java/Makefile.am2
-rw-r--r--lang/python/setup.py2
-rw-r--r--src/async/async_worker.c9
-rw-r--r--src/btree/bt_slvg.c17
-rw-r--r--src/btree/bt_sync.c3
-rw-r--r--src/config/config_collapse.c2
-rw-r--r--src/conn/conn_cache_pool.c4
-rw-r--r--src/conn/conn_ckpt.c4
-rw-r--r--src/conn/conn_dhandle.c6
-rw-r--r--src/conn/conn_log.c14
-rw-r--r--src/conn/conn_stat.c4
-rw-r--r--src/conn/conn_sweep.c91
-rw-r--r--src/evict/evict_lru.c16
-rw-r--r--src/include/extern.h8
-rw-r--r--src/include/os_windows.h14
-rw-r--r--src/include/posix.h12
-rw-r--r--src/lsm/lsm_manager.c6
-rw-r--r--src/lsm/lsm_worker.c6
-rw-r--r--src/meta/meta_ckpt.c2
-rw-r--r--src/os_posix/os_thread.c2
-rw-r--r--src/os_win/os_fallocate.c2
-rw-r--r--src/os_win/os_mtx_cond.c4
-rw-r--r--src/os_win/os_once.c2
-rw-r--r--src/os_win/os_thread.c8
-rw-r--r--src/os_win/os_time.c4
-rw-r--r--src/support/huffman.c8
-rw-r--r--src/txn/txn.c2
-rw-r--r--test/mciproject.yml16
-rw-r--r--test/suite/test_async01.py7
-rw-r--r--test/suite/test_async02.py7
-rw-r--r--test/suite/test_backup02.py7
-rw-r--r--test/suite/test_backup04.py6
-rw-r--r--test/suite/test_base02.py5
-rw-r--r--test/suite/test_base05.py5
-rw-r--r--test/suite/test_bug006.py5
-rw-r--r--test/suite/test_bug008.py7
-rw-r--r--test/suite/test_bulk01.py10
-rw-r--r--test/suite/test_checkpoint01.py25
-rw-r--r--test/suite/test_checkpoint02.py8
-rw-r--r--test/suite/test_cursor01.py5
-rw-r--r--test/suite/test_cursor02.py5
-rw-r--r--test/suite/test_cursor04.py5
-rw-r--r--test/suite/test_cursor06.py10
-rw-r--r--test/suite/test_cursor07.py6
-rw-r--r--test/suite/test_cursor_random.py9
-rw-r--r--test/suite/test_drop.py5
-rw-r--r--test/suite/test_dupc.py5
-rw-r--r--test/suite/test_empty.py5
-rw-r--r--test/suite/test_excl.py5
-rw-r--r--test/suite/test_overwrite.py6
-rw-r--r--test/suite/test_perf001.py5
-rw-r--r--test/suite/test_rename.py5
-rw-r--r--test/suite/test_schema02.py5
-rw-r--r--test/suite/test_schema03.py6
-rw-r--r--test/suite/test_truncate01.py10
-rw-r--r--test/suite/test_txn01.py5
-rw-r--r--test/suite/test_txn03.py6
-rw-r--r--test/suite/test_upgrade.py5
-rw-r--r--test/suite/test_util02.py7
-rw-r--r--test/suite/test_util03.py5
-rw-r--r--test/suite/wtscenario.py13
-rw-r--r--test/suite/wttest.py2
-rw-r--r--test/windows/windows_shim.c7
66 files changed, 328 insertions, 204 deletions
diff --git a/SConstruct b/SConstruct
index 5c4b90992f2..8e9fae28ac6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -68,7 +68,11 @@ var.Add('CFLAGS', 'C Compiler Flags', [
"/wd4090", # Ignore warning about mismatched const qualifiers
"/wd4996", # Ignore deprecated functions
"/W3", # Warning level 3
+ #"/we4244", # Possible loss of data
"/we4013", # Error on undefined functions
+ #"/we4047", # Indirection differences in types
+ #"/we4024", # Differences in parameter types
+ #"/we4100", # Unreferenced local parameter
"/TC", # Compile as C code
#"/Od", # Disable optimization
"/Ob1", # inline expansion
@@ -76,7 +80,7 @@ var.Add('CFLAGS', 'C Compiler Flags', [
"/GF", # enable string pooling
"/EHsc", # extern "C" does not throw
#"/RTC1", # enable stack checks
- "/GS", # enable secrutiy checks
+ "/GS", # enable security checks
"/Gy", # separate functions for linker
"/Zc:wchar_t",
"/Gd",
@@ -97,6 +101,8 @@ var.Add('TOOLS', 'SCons tools', [
"textfile"
])
+var.Add('SWIG', 'SWIG binary location', swig_binary)
+
env = Environment(
variables = var
)
diff --git a/dist/s_string.ok b/dist/s_string.ok
index ab4f3732f75..e2c6380660d 100644
--- a/dist/s_string.ok
+++ b/dist/s_string.ok
@@ -423,6 +423,7 @@ autoheader
bInheritHandle
basecfg
bdb
+beginthreadex
bigram
bitcnt
bitfield
diff --git a/ext/compressors/lz4/lz4_compress.c b/ext/compressors/lz4/lz4_compress.c
index 4c27975f235..e6b8219aafb 100644
--- a/ext/compressors/lz4/lz4_compress.c
+++ b/ext/compressors/lz4/lz4_compress.c
@@ -84,7 +84,7 @@ wt_lz4_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
return (wt_lz4_error(compressor, session,
"LZ4 compress buffer too small", 0));
- /* Store the length of the compressed block in the first 8 bytes */
+ /* Store the length of the compressed block in the first 8 bytes. */
lz4buf = (char *)dst + sizeof(size_t);
lz4_len = (size_t)LZ4_compress((const char *)src, lz4buf, (int)src_len);
@@ -126,7 +126,7 @@ wt_lz4_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
wt_api = ((LZ4_COMPRESSOR *)compressor)->wt_api;
- /* Retrieve compressed length from start of the data buffer */
+ /* Retrieve compressed length from start of the data buffer. */
src_data_len = *(size_t *)src;
if (src_data_len + sizeof(size_t) > src_len) {
(void)wt_api->err_printf(wt_api,
@@ -135,15 +135,17 @@ wt_lz4_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
return (WT_ERROR);
}
- /* Skip over the data size to the start of compressed data */
+ /* Skip over the data size to the start of compressed data. */
compressed_data = (char *)src + sizeof(size_t);
/*
* The destination buffer length should always be sufficient because
- * wiredtiger keeps track of the byte count before compression
+ * wiredtiger keeps track of the byte count before compression. Use
+ * safe decompression: we may be relying on decompression to detect
+ * corruption.
*/
- decoded =
- LZ4_decompress_fast(compressed_data, (char *)dst, (int)dst_len);
+ decoded = LZ4_decompress_safe(
+ compressed_data, (char *)dst, (int)src_data_len, (int)dst_len);
if (decoded < 0)
return (wt_lz4_error(compressor, session,
diff --git a/lang/java/Makefile.am b/lang/java/Makefile.am
index 94a7cb2702d..e6e6f748837 100644
--- a/lang/java/Makefile.am
+++ b/lang/java/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/include
JAVADEST = src/com/wiredtiger/db
JAVADESTFULL = $(srcdir)/$(JAVADEST)
diff --git a/lang/python/setup.py b/lang/python/setup.py
index 28bbe4d07e8..9eb57d55b5c 100644
--- a/lang/python/setup.py
+++ b/lang/python/setup.py
@@ -36,7 +36,7 @@ if not 'ARCHFLAGS' in os.environ:
os.environ['ARCHFLAGS'] = ''
# Suppress warnings building SWIG generated code
-extra_cflags = [ '-w' ]
+extra_cflags = [ '-w', '-I../../src/include']
dir = os.path.dirname(__file__)
diff --git a/src/async/async_worker.c b/src/async/async_worker.c
index ec68598b8c8..543046f7a0c 100644
--- a/src/async/async_worker.c
+++ b/src/async/async_worker.c
@@ -75,7 +75,8 @@ retry:
*/
my_slot = my_consume % async->async_qsize;
prev_slot = last_consume % async->async_qsize;
- *op = WT_ATOMIC_STORE8(async->async_queue[my_slot], NULL);
+ *op = (WT_ASYNC_OP_IMPL*)WT_ATOMIC_STORE8(
+ async->async_queue[my_slot], NULL);
WT_ASSERT(session, async->cur_queue > 0);
WT_ASSERT(session, *op != NULL);
@@ -278,10 +279,10 @@ __async_worker_op(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op,
}
/*
- * __async_worker --
+ * __wt_async_worker --
* The async worker threads.
*/
-void *
+WT_THREAD_RET
__wt_async_worker(void *arg)
{
WT_ASYNC *async;
@@ -354,5 +355,5 @@ err: WT_PANIC_MSG(session, ret, "async worker error");
__wt_free(session, ac);
ac = acnext;
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
diff --git a/src/btree/bt_slvg.c b/src/btree/bt_slvg.c
index 6f0d4946aa5..ba1802116d0 100644
--- a/src/btree/bt_slvg.c
+++ b/src/btree/bt_slvg.c
@@ -124,7 +124,7 @@ static int __slvg_col_range_overlap(
WT_SESSION_IMPL *, uint32_t, uint32_t, WT_STUFF *);
static void __slvg_col_trk_update_start(uint32_t, WT_STUFF *);
static int __slvg_merge_block_free(WT_SESSION_IMPL *, WT_STUFF *);
-static int __slvg_ovfl_compare(const void *, const void *);
+static int WT_CDECL __slvg_ovfl_compare(const void *, const void *);
static int __slvg_ovfl_discard(WT_SESSION_IMPL *, WT_STUFF *);
static int __slvg_ovfl_reconcile(WT_SESSION_IMPL *, WT_STUFF *);
static int __slvg_ovfl_ref(WT_SESSION_IMPL *, WT_TRACK *, int);
@@ -140,9 +140,9 @@ static int __slvg_row_range_overlap(
WT_SESSION_IMPL *, uint32_t, uint32_t, WT_STUFF *);
static int __slvg_row_trk_update_start(
WT_SESSION_IMPL *, WT_ITEM *, uint32_t, WT_STUFF *);
-static int __slvg_trk_compare_addr(const void *, const void *);
-static int __slvg_trk_compare_gen(const void *, const void *);
-static int __slvg_trk_compare_key(const void *, const void *);
+static int WT_CDECL __slvg_trk_compare_addr(const void *, const void *);
+static int WT_CDECL __slvg_trk_compare_gen(const void *, const void *);
+static int WT_CDECL __slvg_trk_compare_key(const void *, const void *);
static int __slvg_trk_free(WT_SESSION_IMPL *, WT_TRACK **, int);
static void __slvg_trk_free_addr(WT_SESSION_IMPL *, WT_TRACK *);
static int __slvg_trk_init(WT_SESSION_IMPL *, uint8_t *,
@@ -2098,7 +2098,7 @@ __slvg_row_ovfl(WT_SESSION_IMPL *session,
* __slvg_trk_compare_addr --
* Compare two WT_TRACK array entries by address cookie.
*/
-static int
+static int WT_CDECL
__slvg_trk_compare_addr(const void *a, const void *b)
{
WT_DECL_RET;
@@ -2124,7 +2124,7 @@ __slvg_trk_compare_addr(const void *a, const void *b)
* __slvg_ovfl_compare --
* Bsearch comparison routine for the overflow array.
*/
-static int
+static int WT_CDECL
__slvg_ovfl_compare(const void *a, const void *b)
{
WT_ADDR *addr;
@@ -2163,6 +2163,7 @@ __slvg_ovfl_reconcile(WT_SESSION_IMPL *session, WT_STUFF *ss)
* with the lowest LSNs until overflow pages are only referenced once.
*
* This requires sorting the page list by LSN, and the overflow array
+
* by address cookie.
*/
qsort(ss->pages,
@@ -2246,7 +2247,7 @@ err: __wt_free(session, slot);
* __slvg_trk_compare_key --
* Compare two WT_TRACK array entries by key, and secondarily, by LSN.
*/
-static int
+static int WT_CDECL
__slvg_trk_compare_key(const void *a, const void *b)
{
WT_SESSION_IMPL *session;
@@ -2303,7 +2304,7 @@ __slvg_trk_compare_key(const void *a, const void *b)
* __slvg_trk_compare_gen --
* Compare two WT_TRACK array entries by LSN.
*/
-static int
+static int WT_CDECL
__slvg_trk_compare_gen(const void *a, const void *b)
{
WT_TRACK *a_trk, *b_trk;
diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c
index bc5d1051b1e..1bbaee4bf1b 100644
--- a/src/btree/bt_sync.c
+++ b/src/btree/bt_sync.c
@@ -145,8 +145,7 @@ __sync_file(WT_SESSION_IMPL *session, int syncop)
}
if (WT_PAGE_IS_INTERNAL(page)) {
- internal_bytes +=
- page->memory_footprint;
+ internal_bytes += page->memory_footprint;
++internal_pages;
} else {
leaf_bytes += page->memory_footprint;
diff --git a/src/config/config_collapse.c b/src/config/config_collapse.c
index f54e4fc2074..23cb03c9b3a 100644
--- a/src/config/config_collapse.c
+++ b/src/config/config_collapse.c
@@ -314,7 +314,7 @@ err: __wt_scr_free(session, &build);
* __config_merge_cmp --
* Qsort function: sort the config merge array.
*/
-static int
+static int WT_CDECL
__config_merge_cmp(const void *a, const void *b)
{
WT_CONFIG_MERGE_ENTRY *ae, *be;
diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c
index 7bf090496a8..488864ce351 100644
--- a/src/conn/conn_cache_pool.c
+++ b/src/conn/conn_cache_pool.c
@@ -596,7 +596,7 @@ __cache_pool_adjust(WT_SESSION_IMPL *session,
* __wt_cache_pool_server --
* Thread to manage cache pool among connections.
*/
-void *
+WT_THREAD_RET
__wt_cache_pool_server(void *arg)
{
WT_CACHE *cache;
@@ -642,5 +642,5 @@ __wt_cache_pool_server(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "cache pool manager server error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
diff --git a/src/conn/conn_ckpt.c b/src/conn/conn_ckpt.c
index 503c22110f9..74f27d8bd18 100644
--- a/src/conn/conn_ckpt.c
+++ b/src/conn/conn_ckpt.c
@@ -69,7 +69,7 @@ err: __wt_scr_free(session, &tmp);
* __ckpt_server --
* The checkpoint server thread.
*/
-static void *
+static WT_THREAD_RET
__ckpt_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -112,7 +112,7 @@ __ckpt_server(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "checkpoint server error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index 7756158594c..9f308a2569c 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -361,8 +361,7 @@ err: __wt_free(session, metaconf);
* Open the current btree handle.
*/
static int
-__conn_btree_open(
- WT_SESSION_IMPL *session, const char *cfg[], uint32_t flags)
+__conn_btree_open(WT_SESSION_IMPL *session, const char *cfg[], uint32_t flags)
{
WT_BTREE *btree;
WT_DATA_HANDLE *dhandle;
@@ -745,7 +744,8 @@ __wt_conn_dhandle_discard_single(WT_SESSION_IMPL *session, int final)
* Kludge: interrupt the eviction server in case it is holding the
* handle list lock.
*/
- F_SET(S2C(session)->cache, WT_CACHE_CLEAR_WALKS);
+ if (!F_ISSET(session, WT_SESSION_HANDLE_LIST_LOCKED))
+ F_SET(S2C(session)->cache, WT_CACHE_CLEAR_WALKS);
/* Try to remove the handle, protected by the data handle lock. */
WT_WITH_DHANDLE_LOCK(session,
diff --git a/src/conn/conn_log.c b/src/conn/conn_log.c
index 4b995114b09..a6d53134ec2 100644
--- a/src/conn/conn_log.c
+++ b/src/conn/conn_log.c
@@ -273,7 +273,7 @@ err:
* __log_close_server --
* The log close server thread.
*/
-static void *
+static WT_THREAD_RET
__log_close_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -332,7 +332,7 @@ err: __wt_err(session, ret, "log close server error");
}
if (locked)
__wt_spin_unlock(session, &log->log_sync_lock);
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
@@ -347,7 +347,7 @@ typedef struct {
* __log_wrlsn_cmp --
* The log wrlsn comparison function for qsort.
*/
-static int
+static int WT_CDECL
__log_wrlsn_cmp(const void *a, const void *b)
{
WT_LOG_WRLSN_ENTRY *ae, *be;
@@ -361,7 +361,7 @@ __log_wrlsn_cmp(const void *a, const void *b)
* __log_wrlsn_server --
* The log wrlsn server thread.
*/
-static void *
+static WT_THREAD_RET
__log_wrlsn_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -450,14 +450,14 @@ __log_wrlsn_server(void *arg)
if (0)
err: __wt_err(session, ret, "log wrlsn server error");
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
* __log_server --
* The log server thread.
*/
-static void *
+static WT_THREAD_RET
__log_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -502,7 +502,7 @@ err: __wt_err(session, ret, "log server error");
}
if (locked)
(void)__wt_writeunlock(session, log->log_archive_lock);
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/conn/conn_stat.c b/src/conn/conn_stat.c
index 83c8d539662..0d008939d8c 100644
--- a/src/conn/conn_stat.c
+++ b/src/conn/conn_stat.c
@@ -380,7 +380,7 @@ err: __wt_scr_free(session, &tmp);
* __statlog_server --
* The statistics server thread.
*/
-static void *
+static WT_THREAD_RET
__statlog_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -419,7 +419,7 @@ err: WT_PANIC_MSG(session, ret, "statistics log server error");
}
__wt_buf_free(session, &path);
__wt_buf_free(session, &tmp);
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/conn/conn_sweep.c b/src/conn/conn_sweep.c
index 50812ccfa95..2a862758e08 100644
--- a/src/conn/conn_sweep.c
+++ b/src/conn/conn_sweep.c
@@ -9,6 +9,42 @@
#include "wt_internal.h"
/*
+ * __sweep_remove_handles --
+ * Remove closed dhandles from the connection list.
+ */
+static int
+__sweep_remove_handles(WT_SESSION_IMPL *session)
+{
+ WT_CONNECTION_IMPL *conn;
+ WT_DATA_HANDLE *dhandle, *dhandle_next;
+ WT_DECL_RET;
+
+ conn = S2C(session);
+ dhandle = SLIST_FIRST(&conn->dhlh);
+
+ for (; dhandle != NULL; dhandle = dhandle_next) {
+ dhandle_next = SLIST_NEXT(dhandle, l);
+ if (WT_IS_METADATA(dhandle))
+ continue;
+
+ /*
+ * If there are no longer any references to the handle in any
+ * sessions, attempt to discard it.
+ */
+ if (F_ISSET(dhandle, WT_DHANDLE_OPEN) ||
+ dhandle->session_inuse != 0 || dhandle->session_ref != 0)
+ continue;
+
+ WT_WITH_DHANDLE(session, dhandle,
+ ret = __wt_conn_dhandle_discard_single(session, 0));
+ WT_RET_BUSY_OK(ret);
+ WT_STAT_FAST_CONN_INCR(session, dh_conn_ref);
+ }
+
+ return (ret);
+}
+
+/*
* __sweep --
* Close unused dhandles on the connection dhandle list.
*/
@@ -16,22 +52,26 @@ static int
__sweep(WT_SESSION_IMPL *session)
{
WT_CONNECTION_IMPL *conn;
- WT_DATA_HANDLE *dhandle, *dhandle_next;
+ WT_DATA_HANDLE *dhandle;
WT_DECL_RET;
time_t now;
- int locked;
+ int closed_handles;
conn = S2C(session);
+ closed_handles = 0;
/* Don't discard handles that have been open recently. */
WT_RET(__wt_seconds(session, &now));
WT_STAT_FAST_CONN_INCR(session, dh_conn_sweeps);
- dhandle = SLIST_FIRST(&conn->dhlh);
- for (; dhandle != NULL; dhandle = dhandle_next) {
- dhandle_next = SLIST_NEXT(dhandle, l);
+ SLIST_FOREACH(dhandle, &conn->dhlh, l) {
if (WT_IS_METADATA(dhandle))
continue;
+ if (!F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
+ dhandle->session_inuse == 0 && dhandle->session_ref == 0) {
+ ++closed_handles;
+ continue;
+ }
if (dhandle->session_inuse != 0 ||
now <= dhandle->timeofdeath + conn->sweep_idle_time)
continue;
@@ -60,42 +100,31 @@ __sweep(WT_SESSION_IMPL *session)
if ((ret =
__wt_try_writelock(session, dhandle->rwlock)) == EBUSY)
continue;
- WT_RET(ret);
- locked = 1;
/* If the handle is open, try to close it. */
if (F_ISSET(dhandle, WT_DHANDLE_OPEN)) {
WT_WITH_DHANDLE(session, dhandle,
ret = __wt_conn_btree_sync_and_close(session, 0));
- if (ret != 0)
- goto unlock;
/* We closed the btree handle, bump the statistic. */
- WT_STAT_FAST_CONN_INCR(session, dh_conn_handles);
+ if (ret == 0)
+ WT_STAT_FAST_CONN_INCR(
+ session, dh_conn_handles);
}
- /*
- * If there are no longer any references to the handle in any
- * sessions, attempt to discard it. The called function
- * re-checks that the handle is not in use, which is why we
- * don't do any special handling of EBUSY returns above.
- */
- if (dhandle->session_inuse == 0 && dhandle->session_ref == 0) {
- WT_WITH_DHANDLE(session, dhandle,
- ret = __wt_conn_dhandle_discard_single(session, 0));
- if (ret != 0)
- goto unlock;
-
- /* If the handle was discarded, it isn't locked. */
- locked = 0;
- } else
- WT_STAT_FAST_CONN_INCR(session, dh_conn_ref);
-
-unlock: if (locked)
- WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
+ if (dhandle->session_inuse == 0 && dhandle->session_ref == 0)
+ ++closed_handles;
+ WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
WT_RET_BUSY_OK(ret);
}
+
+ if (closed_handles) {
+ WT_WITH_DHANDLE_LOCK(session,
+ ret = __sweep_remove_handles(session));
+ WT_RET(ret);
+ }
+
return (0);
}
@@ -103,7 +132,7 @@ unlock: if (locked)
* __sweep_server --
* The handle sweep server thread.
*/
-static void *
+static WT_THREAD_RET
__sweep_server(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -129,7 +158,7 @@ __sweep_server(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "handle sweep server error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index 2ebd699c579..482bf3c9f59 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -10,13 +10,13 @@
static int __evict_clear_walks(WT_SESSION_IMPL *);
static int __evict_has_work(WT_SESSION_IMPL *, uint32_t *);
-static int __evict_lru_cmp(const void *, const void *);
+static int WT_CDECL __evict_lru_cmp(const void *, const void *);
static int __evict_lru_pages(WT_SESSION_IMPL *, int);
static int __evict_lru_walk(WT_SESSION_IMPL *, uint32_t);
static int __evict_pass(WT_SESSION_IMPL *);
static int __evict_walk(WT_SESSION_IMPL *, uint32_t);
static int __evict_walk_file(WT_SESSION_IMPL *, u_int *, uint32_t);
-static void *__evict_worker(void *);
+static WT_THREAD_RET __evict_worker(void *);
static int __evict_server_work(WT_SESSION_IMPL *);
/*
@@ -54,7 +54,7 @@ __evict_read_gen(const WT_EVICT_ENTRY *entry)
* __evict_lru_cmp --
* Qsort function: sort the eviction array.
*/
-static int
+static int WT_CDECL
__evict_lru_cmp(const void *a, const void *b)
{
uint64_t a_lru, b_lru;
@@ -94,7 +94,7 @@ __wt_evict_list_clear_page(WT_SESSION_IMPL *session, WT_REF *ref)
WT_EVICT_ENTRY *evict;
uint32_t i, elem;
- WT_ASSERT(session,
+ WT_ASSERT(session,
__wt_ref_is_root(ref) || ref->state == WT_REF_LOCKED);
/* Fast path: if the page isn't on the queue, don't bother searching. */
@@ -150,7 +150,7 @@ __wt_evict_server_wake(WT_SESSION_IMPL *session)
* __evict_server --
* Thread to evict pages from the cache.
*/
-static void *
+static WT_THREAD_RET
__evict_server(void *arg)
{
WT_CACHE *cache;
@@ -232,7 +232,7 @@ __evict_server(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "cache eviction server error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
@@ -384,7 +384,7 @@ __wt_evict_destroy(WT_SESSION_IMPL *session)
* __evict_worker --
* Thread to help evict pages from the cache.
*/
-static void *
+static WT_THREAD_RET
__evict_worker(void *arg)
{
WT_CACHE *cache;
@@ -413,7 +413,7 @@ __evict_worker(void *arg)
if (0) {
err: WT_PANIC_MSG(session, ret, "cache eviction worker error");
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/include/extern.h b/src/include/extern.h
index fe717f47853..12877c04051 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -8,7 +8,7 @@ extern int __wt_async_flush(WT_SESSION_IMPL *session);
extern int __wt_async_new_op(WT_SESSION_IMPL *session, const char *uri, const char *config, const char *cfg[], WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP_IMPL **opp);
extern int __wt_async_op_enqueue(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op);
extern int __wt_async_op_init(WT_SESSION_IMPL *session);
-extern void *__wt_async_worker(void *arg);
+extern WT_THREAD_RET __wt_async_worker(void *arg);
extern int __wt_block_addr_to_buffer(WT_BLOCK *block, uint8_t **pp, wt_off_t offset, uint32_t size, uint32_t cksum);
extern int __wt_block_buffer_to_addr(WT_BLOCK *block, const uint8_t *p, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump);
extern int __wt_block_addr_valid(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, int live);
@@ -220,7 +220,7 @@ extern int __wt_cache_destroy(WT_SESSION_IMPL *session);
extern int __wt_cache_pool_config(WT_SESSION_IMPL *session, const char **cfg);
extern int __wt_conn_cache_pool_open(WT_SESSION_IMPL *session);
extern int __wt_conn_cache_pool_destroy(WT_SESSION_IMPL *session);
-extern void *__wt_cache_pool_server(void *arg);
+extern WT_THREAD_RET __wt_cache_pool_server(void *arg);
extern int __wt_checkpoint_server_create(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_checkpoint_server_destroy(WT_SESSION_IMPL *session);
extern int __wt_checkpoint_signal(WT_SESSION_IMPL *session, wt_off_t logsize);
@@ -496,7 +496,7 @@ extern int __wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...
extern int __wt_fflush(WT_SESSION_IMPL *session, FILE *fp);
extern int __wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag);
extern uint64_t __wt_strtouq(const char *nptr, char **endptr, int base);
-extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, void *(*func)(void *), void *arg);
+extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg);
extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid);
extern void __wt_thread_id(char *buf, size_t buflen);
extern int __wt_seconds(WT_SESSION_IMPL *session, time_t *timep);
@@ -654,7 +654,7 @@ extern void __wt_stat_refresh_dsrc_stats(void *stats_arg);
extern void __wt_stat_aggregate_dsrc_stats(const void *child, const void *parent);
extern void __wt_stat_init_connection_stats(WT_CONNECTION_STATS *stats);
extern void __wt_stat_refresh_connection_stats(void *stats_arg);
-extern int __wt_txnid_cmp(const void *v1, const void *v2);
+extern int WT_CDECL __wt_txnid_cmp(const void *v1, const void *v2);
extern void __wt_txn_release_snapshot(WT_SESSION_IMPL *session);
extern void __wt_txn_update_oldest(WT_SESSION_IMPL *session);
extern void __wt_txn_refresh(WT_SESSION_IMPL *session, int get_snapshot);
diff --git a/src/include/os_windows.h b/src/include/os_windows.h
index a9c1cf5f65a..49cf4d2a126 100644
--- a/src/include/os_windows.h
+++ b/src/include/os_windows.h
@@ -14,6 +14,18 @@ typedef CONDITION_VARIABLE wt_cond_t;
typedef CRITICAL_SECTION wt_mutex_t;
typedef HANDLE wt_thread_t;
+/*
+ * Thread callbacks need to match the return signature of _beginthreadex.
+ */
+#define WT_THREAD_CALLBACK(x) unsigned (__stdcall x)
+#define WT_THREAD_RET unsigned __stdcall
+#define WT_THREAD_RET_VALUE 0
+
+/*
+ * WT declaration for calling convention type
+ */
+#define WT_CDECL __cdecl
+
#if _MSC_VER < 1900
/* Timespec is a POSIX structure not defined in Windows */
struct timespec {
@@ -29,7 +41,7 @@ struct timespec {
*/
typedef uint32_t u_int;
typedef unsigned char u_char;
-typedef unsigned long u_long;
+typedef uint64_t u_long;
/* <= VS 2013 is not C99 compat */
#if _MSC_VER < 1900
diff --git a/src/include/posix.h b/src/include/posix.h
index 14249e3ed37..1aa629c98e7 100644
--- a/src/include/posix.h
+++ b/src/include/posix.h
@@ -26,3 +26,15 @@
typedef pthread_cond_t wt_cond_t;
typedef pthread_mutex_t wt_mutex_t;
typedef pthread_t wt_thread_t;
+
+/*
+ * Thread callbacks need to match the platform specific callback types
+ */
+#define WT_THREAD_CALLBACK(x) void* (x)
+#define WT_THREAD_RET void*
+#define WT_THREAD_RET_VALUE NULL
+
+/*
+ * WT declaration for calling convention type
+ */
+#define WT_CDECL
diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c
index 75d3e8ef6e8..12b24984fcb 100644
--- a/src/lsm/lsm_manager.c
+++ b/src/lsm/lsm_manager.c
@@ -11,7 +11,7 @@
static int __lsm_manager_aggressive_update(WT_SESSION_IMPL *, WT_LSM_TREE *);
static int __lsm_manager_run_server(WT_SESSION_IMPL *);
-static void * __lsm_worker_manager(void *);
+static WT_THREAD_RET __lsm_worker_manager(void *);
/*
* __wt_lsm_manager_config --
@@ -500,7 +500,7 @@ err: if (dhandle_locked) {
* A thread that manages all open LSM trees, and the shared LSM worker
* threads.
*/
-static void *
+static WT_THREAD_RET
__lsm_worker_manager(void *arg)
{
WT_DECL_RET;
@@ -518,7 +518,7 @@ __lsm_worker_manager(void *arg)
err: WT_PANIC_MSG(session, ret, "LSM worker manager thread error");
}
F_CLR(S2C(session), WT_CONN_SERVER_LSM);
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c
index a376a81f4eb..d1272df763d 100644
--- a/src/lsm/lsm_worker.c
+++ b/src/lsm/lsm_worker.c
@@ -10,7 +10,7 @@
static int __lsm_worker_general_op(
WT_SESSION_IMPL *, WT_LSM_WORKER_ARGS *, int *);
-static void * __lsm_worker(void *);
+static WT_THREAD_RET __lsm_worker(void *);
/*
* __wt_lsm_worker_start --
@@ -82,7 +82,7 @@ err: __wt_lsm_manager_free_work_unit(session, entry);
* __lsm_worker --
* A thread that executes work units for all open LSM trees.
*/
-static void *
+static WT_THREAD_RET
__lsm_worker(void *arg)
{
WT_CONNECTION_IMPL *conn;
@@ -166,5 +166,5 @@ err: __wt_lsm_manager_free_work_unit(session, entry);
WT_PANIC_MSG(session, ret,
"Error in LSM worker thread %d", cookie->id);
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
diff --git a/src/meta/meta_ckpt.c b/src/meta/meta_ckpt.c
index 0a8557c7a33..70c9bf8dfcd 100644
--- a/src/meta/meta_ckpt.c
+++ b/src/meta/meta_ckpt.c
@@ -230,7 +230,7 @@ err: __wt_free(session, namep);
* __ckpt_compare_order --
* Qsort comparison routine for the checkpoint list.
*/
-static int
+static int WT_CDECL
__ckpt_compare_order(const void *a, const void *b)
{
WT_CKPT *ackpt, *bckpt;
diff --git a/src/os_posix/os_thread.c b/src/os_posix/os_thread.c
index 392f997f1ac..c70a04c8df7 100644
--- a/src/os_posix/os_thread.c
+++ b/src/os_posix/os_thread.c
@@ -14,7 +14,7 @@
*/
int
__wt_thread_create(WT_SESSION_IMPL *session,
- wt_thread_t *tidret, void *(*func)(void *), void *arg)
+ wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg)
{
WT_DECL_RET;
diff --git a/src/os_win/os_fallocate.c b/src/os_win/os_fallocate.c
index 9d0a86882c6..f01ef0e101a 100644
--- a/src/os_win/os_fallocate.c
+++ b/src/os_win/os_fallocate.c
@@ -15,6 +15,8 @@
void
__wt_fallocate_config(WT_SESSION_IMPL *session, WT_FH *fh)
{
+ WT_UNUSED(session);
+
fh->fallocate_available = WT_FALLOCATE_AVAILABLE;
/*
diff --git a/src/os_win/os_mtx_cond.c b/src/os_win/os_mtx_cond.c
index a09b744720f..51f6d6533c8 100644
--- a/src/os_win/os_mtx_cond.c
+++ b/src/os_win/os_mtx_cond.c
@@ -46,7 +46,7 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs)
DWORD milliseconds;
WT_DECL_RET;
uint64_t milliseconds64;
- int lasterror, locked;
+ int locked;
locked = 0;
@@ -76,7 +76,7 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs)
*/
if (milliseconds64 >= INFINITE)
milliseconds64 = INFINITE - 1;
- milliseconds = milliseconds64;
+ milliseconds = (DWORD)milliseconds64;
/*
* 0 would mean the CV sleep becomes a TryCV which we do not
diff --git a/src/os_win/os_once.c b/src/os_win/os_once.c
index 179c1bc97f7..bec8c08777c 100644
--- a/src/os_win/os_once.c
+++ b/src/os_win/os_once.c
@@ -19,6 +19,8 @@ BOOL CALLBACK _wt_init_once_callback(
)
{
void(*init_routine)(void) = Parameter;
+ WT_UNUSED(InitOnce);
+ WT_UNUSED(Context);
init_routine();
diff --git a/src/os_win/os_thread.c b/src/os_win/os_thread.c
index 05f7dc15914..b5f13aea4e9 100644
--- a/src/os_win/os_thread.c
+++ b/src/os_win/os_thread.c
@@ -14,14 +14,14 @@
*/
int
__wt_thread_create(WT_SESSION_IMPL *session,
- wt_thread_t *tidret, void *(*func)(void *), void *arg)
+ wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg)
{
/* Spawn a new thread of control. */
- *tidret = CreateThread(NULL, 0, func, arg, 0, NULL);
- if (*tidret != NULL)
+ *tidret = (HANDLE)_beginthreadex(NULL, 0, func, arg, 0, NULL);
+ if (*tidret != 0)
return (0);
- WT_RET_MSG(session, __wt_errno(), "CreateThread");
+ WT_RET_MSG(session, errno, "_beginthreadex");
}
/*
diff --git a/src/os_win/os_time.c b/src/os_win/os_time.c
index 30fde045c54..c51db118ce1 100644
--- a/src/os_win/os_time.c
+++ b/src/os_win/os_time.c
@@ -32,8 +32,10 @@ int
__wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp)
{
uint64_t ns100;
-
FILETIME time;
+
+ WT_UNUSED(session);
+
GetSystemTimeAsFileTime(&time);
ns100 = (((int64_t)time.dwHighDateTime << 32) + time.dwLowDateTime)
diff --git a/src/support/huffman.c b/src/support/huffman.c
index 12f98184b5c..48361551ba1 100644
--- a/src/support/huffman.c
+++ b/src/support/huffman.c
@@ -96,8 +96,8 @@ typedef struct __indexed_byte {
uint32_t frequency;
} INDEXED_SYMBOL;
-static int indexed_freq_compare(const void *, const void *);
-static int indexed_symbol_compare(const void *, const void *);
+static int WT_CDECL indexed_freq_compare(const void *, const void *);
+static int WT_CDECL indexed_symbol_compare(const void *, const void *);
static void make_table(
WT_SESSION_IMPL *, uint8_t *, uint16_t, WT_HUFFMAN_CODE *, u_int);
static void node_queue_close(WT_SESSION_IMPL *, NODE_QUEUE *);
@@ -117,7 +117,7 @@ static void set_codes(WT_FREQTREE_NODE *, WT_HUFFMAN_CODE *, uint16_t, uint8_t);
* indexed_symbol_compare --
* Qsort comparator to order the table by symbol, lowest to highest.
*/
-static int
+static int WT_CDECL
indexed_symbol_compare(const void *a, const void *b)
{
return (((INDEXED_SYMBOL *)a)->symbol >
@@ -131,7 +131,7 @@ indexed_symbol_compare(const void *a, const void *b)
* Qsort comparator to order the table by frequency (the most frequent
* symbols will be at the end of the array).
*/
-static int
+static int WT_CDECL
indexed_freq_compare(const void *a, const void *b)
{
return (((INDEXED_SYMBOL *)a)->frequency >
diff --git a/src/txn/txn.c b/src/txn/txn.c
index 6c06a0af820..a1bec569ce7 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -12,7 +12,7 @@
* __wt_txnid_cmp --
* Compare transaction IDs for sorting / searching.
*/
-int
+int WT_CDECL
__wt_txnid_cmp(const void *v1, const void *v2)
{
uint64_t id1, id2;
diff --git a/test/mciproject.yml b/test/mciproject.yml
index d7f66212b2a..64007bdbd92 100644
--- a/test/mciproject.yml
+++ b/test/mciproject.yml
@@ -57,6 +57,21 @@ tasks:
${test_env_vars|} python ./test/suite/run.py -v 2
+ - name: compile-windows-alt
+ commands:
+ - func: "fetch source"
+ - command: git.apply_patch
+ params:
+ directory: wiredtiger
+ - command: shell.exec
+ params:
+ working_dir: "wiredtiger"
+ script: |
+ set -o errexit
+ set -o verbose
+
+ scons.bat ${smp_command|} "CFLAGS=/Gv /wd4090 /wd4996 /we4047 /we4024 /TC /we4100" wiredtiger.dll libwiredtiger.lib
+
buildvariants:
- name: ubuntu1404
display_name: Ubuntu 14.04
@@ -89,6 +104,7 @@ buildvariants:
smp_command: -j$(grep -c ^processor /proc/cpuinfo)
tasks:
- name: compile-windows
+ - name: compile-windows-alt
- name: osx-108
display_name: OS X 10.8
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):
"""
diff --git a/test/suite/wttest.py b/test/suite/wttest.py
index c1224538c59..628c138e9ae 100644
--- a/test/suite/wttest.py
+++ b/test/suite/wttest.py
@@ -177,6 +177,8 @@ class WiredTigerTestCase(unittest.TestCase):
sys.stderr = WiredTigerTestCase._stderr
def __init__(self, *args, **kwargs):
+ if hasattr(self, 'scenarios'):
+ assert(len(self.scenarios) == len(dict(self.scenarios)))
unittest.TestCase.__init__(self, *args, **kwargs)
if not self._globalSetup:
WiredTigerTestCase.globalSetup()
diff --git a/test/windows/windows_shim.c b/test/windows/windows_shim.c
index 646ebf0c441..8b0f05bfe2d 100644
--- a/test/windows/windows_shim.c
+++ b/test/windows/windows_shim.c
@@ -59,6 +59,7 @@ usleep(useconds_t useconds)
int
pthread_rwlock_destroy(pthread_rwlock_t *lock)
{
+ lock = lock;
return (0);
}
@@ -66,6 +67,7 @@ int
pthread_rwlock_init(pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *ignored)
{
+ ignored = ignored;
InitializeSRWLock(&rwlock->rwlock);
rwlock->exclusive_locked = 0;
@@ -99,13 +101,15 @@ pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
rwlock->exclusive_locked = GetCurrentThreadId();
return (0);
-
}
+#pragma warning( once : 4024 )
+#pragma warning( once : 4047 )
int
pthread_create(pthread_t *tidret, const pthread_attr_t *ignored,
void *(*func)(void *), void * arg)
{
+ ignored = ignored;
*tidret = CreateThread(NULL, 0, func, arg, 0, NULL);
if (*tidret != NULL)
@@ -117,6 +121,7 @@ pthread_create(pthread_t *tidret, const pthread_attr_t *ignored,
int
pthread_join(pthread_t thread, void **ignored)
{
+ ignored = ignored;
WaitForSingleObject(thread, INFINITE);
return (0);
}