summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test
diff options
context:
space:
mode:
authorRamon Fernandez <ramon@mongodb.com>2016-09-26 08:11:23 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-09-26 08:11:23 -0400
commit9dda827a3ae58beef36d53da1b55554cbd8744c4 (patch)
tree6bcd26e1daf5f808a1e5b1dce3f75925aae8b773 /src/third_party/wiredtiger/test
parent0de201d310304852d97a7fd4f3248110c83f29b5 (diff)
downloadmongo-9dda827a3ae58beef36d53da1b55554cbd8744c4.tar.gz
Import wiredtiger: fc0e7abe82595e579573d42448632f7b36a2d154 from branch mongodb-3.4
ref: 5bc03723a7..fc0e7abe82 for: 3.3.15 WT-2864 Reconfiguring the checkpoint server can lead to hangs WT-2874 Change test_compact01 to avoid eviction WT-2918 The dist scripts create C files s_whitespace complains about WT-2919 Don't mask error returns from style checking scripts WT-2921 Reduce the WT_SESSION hazard_size when possible WT-2923 heap-use-after-free on address in compaction WT-2924 Ensure we are doing eviction when threads are waiting for it WT-2925 WT_THREAD_PANIC_FAIL is a WT_THREAD structure flag WT-2926 WT_CONNECTION.reconfigure can attempt unlock of not-locked lock WT-2928 Eviction failing to switch queues can lead to starvation
Diffstat (limited to 'src/third_party/wiredtiger/test')
-rw-r--r--src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c53
-rw-r--r--src/third_party/wiredtiger/test/suite/test_compact01.py8
2 files changed, 47 insertions, 14 deletions
diff --git a/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c b/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c
index 1ff7b10e1c6..b67dae6d647 100644
--- a/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c
+++ b/src/third_party/wiredtiger/test/csuite/wt2719_reconfig/main.c
@@ -27,6 +27,8 @@
*/
#include "test_util.h"
+#include <signal.h>
+
/*
* JIRA ticket reference: WT-2719
* Test case description: Fuzz testing for WiredTiger reconfiguration.
@@ -191,6 +193,41 @@ handle_message(WT_EVENT_HANDLER *handler,
static WT_EVENT_HANDLER event_handler = { NULL, handle_message, NULL, NULL };
+static const char *current; /* Current test configuration */
+
+static void on_alarm(int) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn));
+static void
+on_alarm(int signo)
+{
+ (void)signo; /* Unused parameter */
+
+ fprintf(stderr, "configuration timed out: %s\n", current);
+ abort();
+
+ /* NOTREACHED */
+}
+
+static void
+reconfig(TEST_OPTS *opts, WT_SESSION *session, const char *config)
+{
+ int ret;
+
+ current = config;
+
+ /*
+ * Reconfiguration starts and stops servers, so hangs are more likely
+ * here than in other tests. Don't let the test run too long and get
+ * a core dump when it happens.
+ */
+ (void)alarm(60);
+ if ((ret = opts->conn->reconfigure(opts->conn, config)) != 0) {
+ fprintf(stderr, "%s: %s\n",
+ config, session->strerror(session, ret));
+ exit (EXIT_FAILURE);
+ }
+ (void)alarm(0);
+}
+
int
main(int argc, char *argv[])
{
@@ -200,7 +237,6 @@ main(int argc, char *argv[])
WT_SESSION *session;
size_t len;
u_int i, j;
- int ret;
const char *p;
char *config;
@@ -226,13 +262,12 @@ main(int argc, char *argv[])
len = WT_ELEMENTS(list) * 64;
config = dmalloc(len);
+ /* Set an alarm so we can debug hangs. */
+ (void)signal(SIGALRM, on_alarm);
+
/* A linear pass through the list. */
for (i = 0; i < WT_ELEMENTS(list); ++i)
- if ((ret = opts->conn->reconfigure(opts->conn, list[i])) != 0) {
- fprintf(stderr, "%s: %s\n",
- list[i], session->strerror(session, ret));
- return (EXIT_FAILURE);
- }
+ reconfig(opts, session, list[i]);
/*
* A linear pass through the list, adding random elements.
@@ -264,11 +299,7 @@ main(int argc, char *argv[])
}
strcat(config, p);
}
- if ((ret = opts->conn->reconfigure(opts->conn, config)) != 0) {
- fprintf(stderr, "%s: %s\n",
- config, session->strerror(session, ret));
- return (EXIT_FAILURE);
- }
+ reconfig(opts, session, config);
}
/*
diff --git a/src/third_party/wiredtiger/test/suite/test_compact01.py b/src/third_party/wiredtiger/test/suite/test_compact01.py
index 861e957d18d..8da1a0df4da 100644
--- a/src/third_party/wiredtiger/test/suite/test_compact01.py
+++ b/src/third_party/wiredtiger/test/suite/test_compact01.py
@@ -54,9 +54,11 @@ class test_compact(wttest.WiredTigerTestCase, suite_subprocess):
('utility', dict(utility=1,reopen=0)),
]
scenarios = make_scenarios(types, compact)
- # We want a large cache so that eviction doesn't happen
- # (which could skew our compaction results).
- conn_config = 'cache_size=250MB,statistics=(all)'
+
+ # Configure the connection so that eviction doesn't happen (which could
+ # skew our compaction results).
+ conn_config = 'cache_size=1GB,eviction_checkpoint_target=80,' +\
+ 'eviction_dirty_target=80,eviction_dirty_trigger=95,statistics=(all)'
# Test compaction.
def test_compact(self):