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

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

Merge "binderRpcTest: fix OnewayCallQueueing flake" am: ccb2d05f

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

Change-Id: Ief8a6fb752e3f600b996579a6caba853f7051907
parents 1cfbd1bc ccb2d05f
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1082,15 +1082,18 @@ TEST_P(BinderRpc, OnewayCallQueueing) {

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

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

    // 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);
    }
    // should also be processesed serially
    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());

    size_t epochMsAfter = epochMillis();

    EXPECT_GT(epochMsAfter, epochMsBefore + kSleepMs * kNumSleeps);