aboutsummaryrefslogtreecommitdiffstats
path: root/fnet
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-01-13 23:50:34 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-01-13 23:50:34 +0000
commit78b2d4dd974e2a5d873d647cddfb2480c2396f34 (patch)
tree154f3f6f43eff5ccde293ef9498591c1096f4519 /fnet
parentcf8521a2a3de19d473878359f77a7e096fa9cdec (diff)
- Add the cost to expensive tests.
- Use less resources on the fnet_parallel_rpc test bu just using as many threads as you have cores.
Diffstat (limited to 'fnet')
-rw-r--r--fnet/src/tests/frt/parallel_rpc/parallel_rpc_test.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/fnet/src/tests/frt/parallel_rpc/parallel_rpc_test.cpp b/fnet/src/tests/frt/parallel_rpc/parallel_rpc_test.cpp
index 2577b4e6155..dc5a7e74549 100644
--- a/fnet/src/tests/frt/parallel_rpc/parallel_rpc_test.cpp
+++ b/fnet/src/tests/frt/parallel_rpc/parallel_rpc_test.cpp
@@ -123,23 +123,28 @@ void perform_test(size_t thread_id, Client &client, Result &result) {
CryptoEngine::SP null_crypto = std::make_shared<NullCryptoEngine>();
CryptoEngine::SP xor_crypto = std::make_shared<XorCryptoEngine>();
CryptoEngine::SP tls_crypto = std::make_shared<vespalib::TlsCryptoEngine>(vespalib::test::make_tls_options_for_testing());
+namespace {
+ uint32_t getNumThreads() {
+ return std::max(4u, std::thread::hardware_concurrency());
+ }
+}
-TEST_MT_FFF("parallel rpc with 1/1 transport threads and 128 user threads (no encryption)",
- 128, Server(null_crypto, 1), Client(null_crypto, 1, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
+TEST_MT_FFF("parallel rpc with 1/1 transport threads and num_cores user threads (no encryption)",
+ getNumThreads(), Server(null_crypto, 1), Client(null_crypto, 1, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
-TEST_MT_FFF("parallel rpc with 1/1 transport threads and 128 user threads (xor encryption)",
- 128, Server(xor_crypto, 1), Client(xor_crypto, 1, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
+TEST_MT_FFF("parallel rpc with 1/1 transport threads and num_cores user threads (xor encryption)",
+ getNumThreads(), Server(xor_crypto, 1), Client(xor_crypto, 1, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
-TEST_MT_FFF("parallel rpc with 1/1 transport threads and 128 user threads (tls encryption)",
- 128, Server(tls_crypto, 1), Client(tls_crypto, 1, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
+TEST_MT_FFF("parallel rpc with 1/1 transport threads and num_cores user threads (tls encryption)",
+ getNumThreads(), Server(tls_crypto, 1), Client(tls_crypto, 1, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
-TEST_MT_FFF("parallel rpc with 8/8 transport threads and 128 user threads (no encryption)",
- 128, Server(null_crypto, 8), Client(null_crypto, 8, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
+TEST_MT_FFF("parallel rpc with 8/8 transport threads and num_cores user threads (no encryption)",
+ getNumThreads(), Server(null_crypto, 8), Client(null_crypto, 8, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
-TEST_MT_FFF("parallel rpc with 8/8 transport threads and 128 user threads (xor encryption)",
- 128, Server(xor_crypto, 8), Client(xor_crypto, 8, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
+TEST_MT_FFF("parallel rpc with 8/8 transport threads and num_cores user threads (xor encryption)",
+ getNumThreads(), Server(xor_crypto, 8), Client(xor_crypto, 8, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
-TEST_MT_FFF("parallel rpc with 8/8 transport threads and 128 user threads (tls encryption)",
- 128, Server(tls_crypto, 8), Client(tls_crypto, 8, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
+TEST_MT_FFF("parallel rpc with 8/8 transport threads and num_cores user threads (tls encryption)",
+ getNumThreads(), Server(tls_crypto, 8), Client(tls_crypto, 8, f1), Result(num_threads)) { perform_test(thread_id, f2, f3); }
TEST_MAIN() { TEST_RUN_ALL(); }