summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2023-06-15 02:29:22 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-06-15 02:29:22 +0000
commitfc5273d80c0a7bbada1dc0e94dc0f624e2ffab6c (patch)
treec3580e156fcfd67d84604b7e1746e8bac8e57f63
parent301980e563fdae6971dccd1c542cff31e8618ce8 (diff)
parent1f137ebc831fc1204aa9623037c7342a49886bd3 (diff)
Merge "binderRpcTest: threadpool race leak" am: bdac3ea1c2 am: a51585cb19 am: 14f09ec7d1 am: 9e7e1717e4 am: 5046480d6f am: 1f137ebc83
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2626196 Change-Id: Ida91ec071623db3ee5ab6cbb34e3f2a671402a3f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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) {