Merge "Fix testSetOemNetworkPreferenceForTestPref flake" into main

This commit is contained in:
Treehugger Robot
2023-09-26 08:43:15 +00:00
committed by Gerrit Code Review

View File

@@ -2723,7 +2723,8 @@ public class ConnectivityManagerTest {
// the network with the TEST transport. Also wait for validation here, in case there
// is a bug that's only visible when the network is validated.
setWifiMeteredStatusAndWait(ssid, true /* isMetered */, true /* waitForValidation */);
defaultCallback.expect(CallbackEntry.LOST, wifiNetwork, NETWORK_CALLBACK_TIMEOUT_MS);
defaultCallback.eventuallyExpect(CallbackEntry.LOST, NETWORK_CALLBACK_TIMEOUT_MS,
l -> l.getNetwork().equals(wifiNetwork));
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