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 Change-Id: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
This commit is contained in:
committed by
Lorenzo Colitti
parent
ee8feba3c1
commit
c8d9a5706e
@@ -106,6 +106,7 @@ public class ConnectivityDiagnosticsManagerTest {
|
|||||||
private static final int UNKNOWN_DETECTION_METHOD = 4;
|
private static final int UNKNOWN_DETECTION_METHOD = 4;
|
||||||
private static final int FILTERED_UNKNOWN_DETECTION_METHOD = 0;
|
private static final int FILTERED_UNKNOWN_DETECTION_METHOD = 0;
|
||||||
private static final int CARRIER_CONFIG_CHANGED_BROADCAST_TIMEOUT = 5000;
|
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();
|
private static final Executor INLINE_EXECUTOR = x -> x.run();
|
||||||
|
|
||||||
@@ -266,7 +267,8 @@ public class ConnectivityDiagnosticsManagerTest {
|
|||||||
// CS does not trigger NetworkCallback#onCapabilitiesChanged as changing the
|
// CS does not trigger NetworkCallback#onCapabilitiesChanged as changing the
|
||||||
// administratorUids is not a publicly visible change. In lieu of a better signal to
|
// administratorUids is not a publicly visible change. In lieu of a better signal to
|
||||||
// detministically wait for, use Thread#sleep here.
|
// 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 =
|
final TestConnectivityDiagnosticsCallback connDiagsCallback =
|
||||||
createAndRegisterConnectivityDiagnosticsCallback(CELLULAR_NETWORK_REQUEST);
|
createAndRegisterConnectivityDiagnosticsCallback(CELLULAR_NETWORK_REQUEST);
|
||||||
|
|||||||
Reference in New Issue
Block a user