Add new version of createUser performance test

Similar to what was done for switchUser, this commit adds a new version
of the createUser test. In this variation, a wait for cool down was added
in between iterations.

Bug: 261621873
Test: atest UserLifecycleTests#createUser_realistic
Change-Id: I6235c782254b2a19f9990994b664ad9ac5c6f2ce
This commit is contained in:
João Victor Mendes Freire
2023-01-05 17:35:43 +00:00
parent f45b9cae4b
commit 149aab0aa6

View File

@@ -179,6 +179,21 @@ public class UserLifecycleTests {
}
}
/** Tests creating a new user, with wait times between iterations. */
@Test(timeout = TIMEOUT_MAX_TEST_TIME_MS)
public void createUser_realistic() throws RemoteException {
while (mRunner.keepRunning()) {
Log.i(TAG, "Starting timer");
final int userId = createUserNoFlags();
mRunner.pauseTiming();
Log.i(TAG, "Stopping timer");
removeUser(userId);
waitCoolDownPeriod();
mRunner.resumeTimingForNextIteration();
}
}
/** Tests creating and starting a new user. */
@Test(timeout = TIMEOUT_MAX_TEST_TIME_MS)
public void createAndStartUser() throws RemoteException {