diff options
| -rw-r--r-- | libs/binder/tests/binderRpcTest.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp index 407a79194f..b520f4ffc9 100644 --- a/libs/binder/tests/binderRpcTest.cpp +++ b/libs/binder/tests/binderRpcTest.cpp @@ -439,8 +439,7 @@ TEST_P(BinderRpc, ThreadPoolGreaterThanEqualRequested) { for (auto& t : ts) t.join(); } -static void testThreadPoolOverSaturated(sp<IBinderRpcTest> iface, size_t numCalls, - size_t sleepMs = 500) { +static void testThreadPoolOverSaturated(sp<IBinderRpcTest> iface, size_t numCalls, size_t sleepMs) { size_t epochMsBefore = epochMillis(); std::vector<std::thread> ts; @@ -466,7 +465,7 @@ TEST_P(BinderRpc, ThreadPoolOverSaturated) { constexpr size_t kNumThreads = 10; constexpr size_t kNumCalls = kNumThreads + 3; auto proc = createRpcTestSocketServerProcess({.numThreads = kNumThreads}); - testThreadPoolOverSaturated(proc.rootIface, kNumCalls); + testThreadPoolOverSaturated(proc.rootIface, kNumCalls, 250 /*ms*/); } TEST_P(BinderRpc, ThreadPoolLimitOutgoing) { @@ -479,7 +478,7 @@ TEST_P(BinderRpc, ThreadPoolLimitOutgoing) { constexpr size_t kNumCalls = kNumOutgoingConnections + 3; auto proc = createRpcTestSocketServerProcess( {.numThreads = kNumThreads, .numOutgoingConnections = kNumOutgoingConnections}); - testThreadPoolOverSaturated(proc.rootIface, kNumCalls); + testThreadPoolOverSaturated(proc.rootIface, kNumCalls, 250 /*ms*/); } TEST_P(BinderRpc, ThreadingStressTest) { @@ -487,9 +486,9 @@ TEST_P(BinderRpc, ThreadingStressTest) { GTEST_SKIP() << "This test requires multiple threads"; } - constexpr size_t kNumClientThreads = 10; - constexpr size_t kNumServerThreads = 10; - constexpr size_t kNumCalls = 100; + constexpr size_t kNumClientThreads = 5; + constexpr size_t kNumServerThreads = 5; + constexpr size_t kNumCalls = 50; auto proc = createRpcTestSocketServerProcess({.numThreads = kNumServerThreads}); |