summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-03-10 16:23:47 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-03-10 16:23:47 -0400
commiteef2a288b58d504897f09d656437857a9aec3531 (patch)
treefeb6248a5809d3f2552920cd7f320d4ebf6f2892 /test
parentf7592fd6660d44b5e4ea082270170a25a7b5cdcf (diff)
downloadmongo-eef2a288b58d504897f09d656437857a9aec3531.tar.gz
Simplify "threads" configuration, it's no different than other values.
Diffstat (limited to 'test')
-rw-r--r--test/format/config.c13
-rw-r--r--test/format/config.h4
2 files changed, 10 insertions, 7 deletions
diff --git a/test/format/config.c b/test/format/config.c
index e801827935c..378b43f4815 100644
--- a/test/format/config.c
+++ b/test/format/config.c
@@ -107,11 +107,6 @@ config_setup(void)
strcat(g.uri, "dev1/");
strcat(g.uri, WT_NAME);
- /* Default single-threaded 10% of the time. */
- cp = config_find("threads", strlen("threads"));
- if (!(cp->flags & C_PERM))
- *cp->v = MMRAND(1, 100) < 10 ? 1: CONF_RAND(cp);
-
/* Fill in random values for the rest of the run. */
for (cp = c; cp->name != NULL; ++cp) {
if (cp->flags & (C_IGNORE | C_PERM | C_TEMP))
@@ -128,6 +123,14 @@ config_setup(void)
*cp->v = CONF_RAND(cp);
}
+ /*
+ * If worker threads not configured, default to single-threaded 5%
+ * of the time.
+ */
+ cp = config_find("threads", strlen("threads"));
+ if (!(cp->flags & C_PERM) && MMRAND(1, 100) <= 5)
+ *cp->v = 1;
+
/* Required shared libraries. */
if (DATASOURCE("helium") && access(HELIUM_PATH, R_OK) != 0)
die(errno, "Levyx/helium shared library: %s", HELIUM_PATH);
diff --git a/test/format/config.h b/test/format/config.h
index b12b42a3a34..cc084d5b238 100644
--- a/test/format/config.h
+++ b/test/format/config.h
@@ -259,8 +259,8 @@ static CONFIG c[] = {
C_BOOL, 5, 0, 0, &g.c_statistics_server, NULL },
{ "threads",
- "the number of threads",
- C_IGNORE, 1, 32, 128, &g.c_threads, NULL },
+ "the number of worker threads",
+ 0x0, 1, 32, 128, &g.c_threads, NULL },
{ "timer",
"maximum time to run in minutes (default 20 minutes)",