Updates doTestAllowedUids to wait network Lost
doTestAllowedUids did not wait the network disconnect and this made the
test flaky since doTestAllowedUids saw the network from the previous
doTestAllowedUids.
This CL update doTestAllowedUids to wait network Lost
Before this CL, test failed 6 times in 1000 tries.
After this CL, test does not fail in 1000 tries.
Test: atest testAllowedUids --iterations 1000
Bug: 312206245
Change-Id: I270a230c15dfd2c44ba29f203bc55c0f47649e98
diff --git a/tests/cts/net/src/android/net/cts/NetworkAgentTest.kt b/tests/cts/net/src/android/net/cts/NetworkAgentTest.kt
index fe2f813..84b6745 100644
--- a/tests/cts/net/src/android/net/cts/NetworkAgentTest.kt
+++ b/tests/cts/net/src/android/net/cts/NetworkAgentTest.kt
@@ -626,6 +626,7 @@
}
}
agent.unregister()
+ callback.eventuallyExpect<Lost> { it.network == agent.network }
// callback will be unregistered in tearDown()
}