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

Commit 77ccead3 authored by Yasin Kilicdere's avatar Yasin Kilicdere
Browse files

Make switch user test measurements consistent with each other.

In UserLifecycleTests switchUser and switchUser_running test methods
wait for UserSwitchObserver.onUserSwitchComplete callback,
whereas switchUser_stopped waits for ACTION_USER_UNLOCKED broadcast
after triggering the user switch.

Which makes the results incomparable and also shows switchUser_stopped
is running faster than switchUser_running, but it makes more sense
the other way around.

This CL makes sure the tests wait for and measure the same thing
to make the results comparable.

Bug: 242843357
Test: atest MultiUserPerfTests:android.multiuser.UserLifecycleTests#switchUser_stopped --no-bazel-mode
Change-Id: I250ceef1ae9ce0adec40972b7962932066121c4f
parent cb2ec7b3
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -273,9 +273,7 @@ public class UserLifecycleTests {
            mRunner.resumeTiming();
            Log.i(TAG, "Starting timer");

            runThenWaitForBroadcasts(testUser, () -> {
                mAm.switchUser(testUser);
            }, Intent.ACTION_USER_UNLOCKED);
            switchUser(testUser);

            mRunner.pauseTiming();
            Log.i(TAG, "Stopping timer");