Increase timeout to wait the default network is restored
3 seconds were too short to wait the network validation.
This CL also updates error message to include more information that
helps investigation.
Test: TH
Bug: 354475907
Bug: 354475880
Bug: 354104252
Change-Id: I513a5bd8af44df47f18773f8fa49323986757e0d
diff --git a/staticlibs/testutils/devicetests/com/android/testutils/DefaultNetworkRestoreMonitor.kt b/staticlibs/testutils/devicetests/com/android/testutils/DefaultNetworkRestoreMonitor.kt
index 1b709b2..4a594e6 100644
--- a/staticlibs/testutils/devicetests/com/android/testutils/DefaultNetworkRestoreMonitor.kt
+++ b/staticlibs/testutils/devicetests/com/android/testutils/DefaultNetworkRestoreMonitor.kt
@@ -34,7 +34,7 @@
class DefaultNetworkRestoreMonitor(
ctx: Context,
private val notifier: RunNotifier,
- private val timeoutMs: Long = 3000
+ private val timeoutMs: Long = 30_000
) {
var firstFailure: Exception? = null
var initialTransports = 0L
@@ -56,8 +56,8 @@
it.caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)
}
} catch (e: AssertionError) {
- firstFailure = IllegalStateException(desc.methodName +
- " does not restore the default network")
+ firstFailure = IllegalStateException(desc.methodName + " does not restore the" +
+ "default network, initialTransports = $initialTransports", e)
} finally {
cm.unregisterNetworkCallback(cb)
}