Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47a12010 authored by Devin Moore's avatar Devin Moore
Browse files

binderRpcTest: assert on wait_for timeout

Use a version of wait_for that won't return for spurious wakeups.

Test: atest binderRpcTest
Bug: NA
Change-Id: I42ad6eb66d36759193980e1532ac9e6ec7565435
parent fc20cdf5
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1062,10 +1062,7 @@ TEST_P(BinderRpc, SingleDeathRecipient) {
    }

    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));