Make the timeout for user removal 40 seconds in UserManagerTest.

BlockingBroadcastReceiver has 4 minutes of timeout by default. This
CL topic makes it customizable and sets it to 40 seconds for user
removal.

Bug: 267760314
Test: atest com.android.server.pm.UserManagerTest
Change-Id: Ib3017fd38357abe005a5a2aa5e9cd987cf5673ef
This commit is contained in:
Yasin Kilicdere
2023-02-03 15:55:56 +00:00
parent e9335b8e98
commit c3cb82a585

View File

@@ -72,6 +72,7 @@ public final class UserManagerTest {
private static final long EPOCH_PLUS_30_YEARS = 30L * 365 * 24 * 60 * 60 * 1000L; // 30 years
private static final int SWITCH_USER_TIMEOUT_SECONDS = 40; // 40 seconds
private static final int REMOVE_USER_TIMEOUT_SECONDS = 40; // 40 seconds
// Packages which are used during tests.
private static final String[] PACKAGES = new String[] {
@@ -1472,6 +1473,7 @@ public final class UserManagerTest {
BlockingBroadcastReceiver blockingBroadcastReceiver = BlockingBroadcastReceiver.create(
mContext, Intent.ACTION_USER_REMOVED, checker);
blockingBroadcastReceiver.setTimeout(REMOVE_USER_TIMEOUT_SECONDS);
blockingBroadcastReceiver.register();
try (blockingBroadcastReceiver) {