From 4dad9710e1f82a09b4f6b3b1b0c325439cfbcba5 Mon Sep 17 00:00:00 2001 From: James Mattis Date: Wed, 16 Jun 2021 19:11:45 -0700 Subject: [PATCH] Updating timeout for Per-App CTS Increasing the timeout values for waiting for callbacks for the per-app CTS tests to match the timeout value used in the waitForAvailable() helper method. Bug: 191230288 Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest Change-Id: I49e5a99f18a5651370e6914f30be659134b537ff --- .../net/src/android/net/cts/ConnectivityManagerTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java index b249abfae8..17fc9c1717 100644 --- a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java +++ b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java @@ -2197,7 +2197,8 @@ public class ConnectivityManagerTest { // Validate when setting unmetered to metered, unmetered is lost and replaced by the // network with the TEST transport. setWifiMeteredStatusAndWait(ssid, true /* isMetered */); - defaultCallback.expectCallback(CallbackEntry.LOST, wifiNetwork); + defaultCallback.expectCallback(CallbackEntry.LOST, wifiNetwork, + NETWORK_CALLBACK_TIMEOUT_MS); waitForAvailable(defaultCallback, tnt.getNetwork()); // Depending on if this device has cellular connectivity or not, multiple available // callbacks may be received. Eventually, metered Wi-Fi should be the final available @@ -2207,7 +2208,8 @@ public class ConnectivityManagerTest { } finally { // Validate that removing the test network will fallback to the default network. runWithShellPermissionIdentity(tnt::teardown); - defaultCallback.expectCallback(CallbackEntry.LOST, tnt.getNetwork()); + defaultCallback.expectCallback(CallbackEntry.LOST, tnt.getNetwork(), + NETWORK_CALLBACK_TIMEOUT_MS); waitForAvailable(defaultCallback); setWifiMeteredStatusAndWait(ssid, oldMeteredValue); @@ -2243,7 +2245,8 @@ public class ConnectivityManagerTest { waitForAvailable(systemDefaultCallback, wifiNetwork); } finally { runWithShellPermissionIdentity(tnt::teardown); - defaultCallback.expectCallback(CallbackEntry.LOST, tnt.getNetwork()); + defaultCallback.expectCallback(CallbackEntry.LOST, tnt.getNetwork(), + NETWORK_CALLBACK_TIMEOUT_MS); // This network preference should only ever use the test network therefore available // should not trigger when the test network goes down (e.g. switch to cellular).