Fix a way for this test to flake.
While tests are hopefully cleaning up after themselves,
there is no guarantee that there is a currently available
default network milliseconds after any given test. Some
tests need to disconnect to check something, or to change
a property of the wifi network that they have to revert at
the end for example. Or, a test may fail leaving the device
without a default network.
To make sure the state is correctly cleaned up, have
tearDown make sure the device is connected to a working
Internet connection before the test ends, so that the next
test can be sure to find established connectivity
immediately. It's possible the device needs a few hundred
milliseconds to re-establish connectivity, so this patch
gives a grace of up to 30 seconds (the default waiting
timer for TestCallback) for connectivity to be restored at
the end of any test.
Bug: 161767594 and others
Test: ConnectivityManagerTest
Change-Id: I8cf3e6e6c116cabd5b04bf2562da84f7e635ca2a
1 file changed
tree: 21a513507ca1039d95282c3b980f3899dc8c3b8d
- tests/