diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-09-26 17:05:01 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-09-26 17:05:01 +1000 |
commit | fc0e7abe82595e579573d42448632f7b36a2d154 (patch) | |
tree | b5a19458b0a49252b4231f1660fc63553b439268 /test | |
parent | 5bc03723a7e77c96b1d5e45a97173654872c727a (diff) | |
parent | 5fb852354745b9efe638183084ee00db821aa132 (diff) | |
download | mongodb-3.4.0-rc0.tar.gz |
Merge branch 'develop' into mongodb-3.4mongodb-3.4.0-rc0mongodb-3.3.15
Diffstat (limited to 'test')
-rw-r--r-- | test/csuite/wt2719_reconfig/main.c | 53 | ||||
-rw-r--r-- | test/suite/test_compact01.py | 8 |
2 files changed, 47 insertions, 14 deletions
diff --git a/test/csuite/wt2719_reconfig/main.c b/test/csuite/wt2719_reconfig/main.c index 1ff7b10e1c6..b67dae6d647 100644 --- a/test/csuite/wt2719_reconfig/main.c +++ b/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/test/suite/test_compact01.py b/test/suite/test_compact01.py index 861e957d18d..8da1a0df4da 100644 --- a/test/suite/test_compact01.py +++ b/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): |