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

Commit 81d680fb authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "binderRpcTest: fix OnewayCallQueueing flake" am: ccb2d05f am:...

Merge "binderRpcTest: fix OnewayCallQueueing flake" am: ccb2d05f am: 94543390 am: 8b9d6339 am: 0730e71e am: c50b4e89

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1830384

Change-Id: Iacd6c867fff0ba0511cc315c572b9a9b4b244477
parents 9b2f0cf9 c50b4e89
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -1082,15 +1082,18 @@ TEST_P(BinderRpc, OnewayCallQueueing) {


    EXPECT_OK(proc.rootIface->lock());
    EXPECT_OK(proc.rootIface->lock());


    for (size_t i = 0; i < kNumSleeps; i++) {
    size_t epochMsBefore = epochMillis();
        // these should be processed serially

    // all these *Async commands should be queued on the server sequentially,
    // even though there are multiple threads.
    for (size_t i = 0; i + 1 < kNumSleeps; i++) {
        proc.rootIface->sleepMsAsync(kSleepMs);
        proc.rootIface->sleepMsAsync(kSleepMs);
    }
    }
    // should also be processesed serially
    EXPECT_OK(proc.rootIface->unlockInMsAsync(kSleepMs));
    EXPECT_OK(proc.rootIface->unlockInMsAsync(kSleepMs));


    size_t epochMsBefore = epochMillis();
    // this can only return once the final async call has unlocked
    EXPECT_OK(proc.rootIface->lockUnlock());
    EXPECT_OK(proc.rootIface->lockUnlock());

    size_t epochMsAfter = epochMillis();
    size_t epochMsAfter = epochMillis();


    EXPECT_GT(epochMsAfter, epochMsBefore + kSleepMs * kNumSleeps);
    EXPECT_GT(epochMsAfter, epochMsBefore + kSleepMs * kNumSleeps);