Merge "binderRpcTest: assert on wait_for timeout" am: 453334dab3 am: 9132781781 am: c1438662aa am: 29d6ddfca5 am: 12528b1836
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2190036
Change-Id: I677bee301a0161d35ee3998ea5e2aea58e340392
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp
index 0ee15a1..b59308c 100644
--- a/libs/binder/tests/binderRpcTest.cpp
+++ b/libs/binder/tests/binderRpcTest.cpp
@@ -1095,10 +1095,7 @@
}
std::unique_lock<std::mutex> lock(dr->mMtx);
- if (!dr->dead) {
- EXPECT_EQ(std::cv_status::no_timeout, dr->mCv.wait_for(lock, 1000ms));
- }
- EXPECT_TRUE(dr->dead) << "Failed to receive the death notification.";
+ ASSERT_TRUE(dr->mCv.wait_for(lock, 1000ms, [&]() { return dr->dead; }));
// need to wait for the session to shutdown so we don't "Leak session"
EXPECT_TRUE(proc.proc.sessions.at(0).session->shutdownAndWait(true));