Increase ConnDiagsTest timeout for end-to-end test.

This change increases the delay allowed for administratorUid updates to
reach ConnectivityService in #testRegisterCallbackWithCarrierPrivileges.
Currently, there is no deterministic signal that can be used to wait for
this change, so Thread#sleep is required. This value is increased
because the previous delay did not give enough time for the
administratorUid change to reach CS, causing test flake.

Bug: 159718782
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Original-Change: https://android-review.googlesource.com/1349068
Merged-In: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
Change-Id: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
This commit is contained in:
Lorenzo Colitti
2020-06-26 07:48:13 +00:00
committed by Chalard Jean
parent 4feab037a5
commit af7ca2d11f

View File

@@ -107,6 +107,7 @@ public class ConnectivityDiagnosticsManagerTest {
private static final int UNKNOWN_DETECTION_METHOD = 4;
private static final int FILTERED_UNKNOWN_DETECTION_METHOD = 0;
private static final int CARRIER_CONFIG_CHANGED_BROADCAST_TIMEOUT = 5000;
private static final int DELAY_FOR_ADMIN_UIDS_MILLIS = 2000;
private static final Executor INLINE_EXECUTOR = x -> x.run();
@@ -268,7 +269,8 @@ public class ConnectivityDiagnosticsManagerTest {
// CS does not trigger NetworkCallback#onCapabilitiesChanged as changing the
// administratorUids is not a publicly visible change. In lieu of a better signal to
// detministically wait for, use Thread#sleep here.
Thread.sleep(500);
// TODO(b/157949581): replace this Thread#sleep with a deterministic signal
Thread.sleep(DELAY_FOR_ADMIN_UIDS_MILLIS);
final TestConnectivityDiagnosticsCallback connDiagsCallback =
createAndRegisterConnectivityDiagnosticsCallback(CELLULAR_NETWORK_REQUEST);