summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2021-09-20 22:31:46 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-09-20 22:31:46 +0000
commit0730e71e7b24d5a5e7be31ea85c0fda47a5ca93b (patch)
tree6fd41762e5e87370394ef174c52307b46b809eeb /libs
parentddf8d7998626c14fae353b9e918932a94c0cb849 (diff)
parent8b9d6339e8fe9e0335486b6d9995b3b5509b5c88 (diff)
Merge "binderRpcTest: fix OnewayCallQueueing flake" am: ccb2d05f80 am: 945433906a am: 8b9d6339e8
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1830384 Change-Id: Iaf54f38ff4f3b7c27297de2ac7d886da6798145e
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/tests/binderRpcTest.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp
index cc1d2fae56..84e8ac643a 100644
--- a/libs/binder/tests/binderRpcTest.cpp
+++ b/libs/binder/tests/binderRpcTest.cpp
@@ -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);