aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-08-21 09:31:16 -0400
committerJack Lloyd <[email protected]>2019-08-21 09:31:16 -0400
commitf4f8dc439252589263bb20221d5b865fa60b4343 (patch)
tree6de64b051a1a80a3e296179062b589ce4d1c1fbd
parent435a246513a6c0a9b20da7f6a53d0efaf886f7cb (diff)
In threaded mode tests, disable mlock pool unless requested
-rw-r--r--src/tests/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tests/main.cpp b/src/tests/main.cpp
index b6f7c4188..d6815bd31 100644
--- a/src/tests/main.cpp
+++ b/src/tests/main.cpp
@@ -74,6 +74,17 @@ int main(int argc, char* argv[])
return 0;
}
+#if defined(BOTAN_TARGET_OS_HAS_POSIX1) && defined(BOTAN_HAS_THREAD_UTILS)
+ /*
+ The mlock pool becomes a major contention point when many threads are running,
+ so disable it unless it was explicitly asked for via setting the env variable
+ */
+ if(parser.get_arg_sz("test-threads") != 1)
+ {
+ ::setenv("BOTAN_MLOCK_POOL_SIZE", "0", /*overwrite=*/0);
+ }
+#endif
+
const Botan_Tests::Test_Options opts(
parser.get_arg_list("suites"),
parser.get_arg_list("skip-tests"),