Explicitly add "flush-broadcast-loopers" option.
Recently, flushing the broadcast loopers behavior, when "wait-for-broadcast-barrier" command is invoked, is made optional which resulted in some regressions in multi-user tests as they same to be relying on flushing the broadcast loopers behavior. So, explicitly add this option when invoking the command. Bug: 282848750 Test: atest android.multiuser.UserLifecycleTests Change-Id: I6ba4e0858a63653b731c7a24b600ce9af758d39c
This commit is contained in:
@@ -80,7 +80,7 @@ public class BenchmarkRunner {
|
||||
|
||||
private void prepareForNextRun() {
|
||||
SystemClock.sleep(COOL_OFF_PERIOD_MS);
|
||||
ShellHelper.runShellCommand("am wait-for-broadcast-idle");
|
||||
ShellHelper.runShellCommand("am wait-for-broadcast-idle --flush-broadcast-loopers");
|
||||
mStartTimeNs = System.nanoTime();
|
||||
mPausedDurationNs = 0;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class BenchmarkRunner {
|
||||
* to avoid unnecessary waiting.
|
||||
*/
|
||||
public void resumeTiming() {
|
||||
ShellHelper.runShellCommand("am wait-for-broadcast-idle");
|
||||
ShellHelper.runShellCommand("am wait-for-broadcast-idle --flush-broadcast-loopers");
|
||||
resumeTimer();
|
||||
}
|
||||
|
||||
|
||||
@@ -1541,7 +1541,8 @@ public class UserLifecycleTests {
|
||||
|
||||
private void waitForBroadcastIdle() {
|
||||
try {
|
||||
ShellHelper.runShellCommandWithTimeout("am wait-for-broadcast-idle", TIMEOUT_IN_SECOND);
|
||||
ShellHelper.runShellCommandWithTimeout(
|
||||
"am wait-for-broadcast-idle --flush-broadcast-loopers", TIMEOUT_IN_SECOND);
|
||||
} catch (TimeoutException e) {
|
||||
Log.e(TAG, "Ending waitForBroadcastIdle because it is taking too long", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user