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

Commit 27f620a7 authored by Steven Moreland's avatar Steven Moreland
Browse files

binderRpcTest: cut down a few tests (part I)

We're hitting timeouts on this test again. Taking
a few cheap wins.

Bug: 271860373
Test: binderRpcTest
Change-Id: I5e0dd1d383cfa1bcede197ee63fe47bfbd279cdb
parent 65fac116
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -435,8 +435,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;
@@ -462,7 +461,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) {
@@ -475,7 +474,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) {
@@ -483,9 +482,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});