Fix flakes in tests running after testIsPrivateDnsBroken

The test would not reconnect wifi after restoring the private DNS setting,
so validation would not be triggered, and it would remain identified as
having broken private DNS.

Reconnect wifi after the test to avoid affecting subsequent tests.

Change-Id: Id9beba94e0fed85bd26c0509ad61369be794f3c3
Test: atest android.net.cts.ConnectivityManagerTest
Bug: 182296835
This commit is contained in:
Remi NGUYEN VAN
2021-06-28 06:58:47 +00:00
parent abbee98e86
commit 582770ce68

View File

@@ -736,6 +736,8 @@ public class ConnectivityManagerTest {
.isPrivateDnsBroken()) && networkForPrivateDns.equals(entry.getNetwork())); .isPrivateDnsBroken()) && networkForPrivateDns.equals(entry.getNetwork()));
} finally { } finally {
mCtsNetUtils.restorePrivateDnsSetting(); mCtsNetUtils.restorePrivateDnsSetting();
// Toggle wifi to make sure it is re-validated
reconnectWifi();
} }
} }