summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2023-06-14 19:33:37 +0000
committer Steven Moreland <smoreland@google.com> 2023-06-14 19:41:31 +0000
commit0ebdaad0defde25b6391504ca96ca3c406777cc7 (patch)
tree6237e532678eee3dc41c705f9fa0888334041fbd
parent0c590d71bd97558e8b456c1a0b74e53a9e5129af (diff)
binderRpcTest: threadpool race leak
SessionWithIncomingThreadpoolDoesntLeak is flaking at 0.02%. This is another small fix to avoid noise in the tests. It's not great, but we know it works because OnewayCallExhaustion uses this solution and does not flake. Bug: 285206261 Test: binderRpcTest --gtest_filter="*SessionWithIncomingThreadpoolDoesntLeak*" Change-Id: I8a1678e9633db71cb4afda2f0f5c108ca784f803
-rw-r--r--libs/binder/tests/binderRpcTest.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp
index 1ff1de4db8..d352ce5bca 100644
--- a/libs/binder/tests/binderRpcTest.cpp
+++ b/libs/binder/tests/binderRpcTest.cpp
@@ -691,7 +691,11 @@ TEST_P(BinderRpc, SessionWithIncomingThreadpoolDoesntLeak) {
EXPECT_EQ(nullptr, session.promote());
- sleep(1); // give time for remote session to shutdown
+ // now that it has died, wait for the remote session to shutdown
+ std::vector<int32_t> remoteCounts;
+ do {
+ EXPECT_OK(proc.rootIface->countBinders(&remoteCounts));
+ } while (remoteCounts.size() > 1);
}
TEST_P(BinderRpc, SingleDeathRecipient) {