ConnectivityServiceTest: fix flakyness
This patch attempts to fix the remaining spurious failures in ConnectivityServiceTest, which have two causes: - waitForIdle() does not take into account the NetworkAgents handlers. - the deadlines in testRequestBenchmark are sometimes exceeded. To fix the first issue, waitForIdle() is moved to a test level instance method and also calls waitForIdleHandler on any non null MockNetworkAgent. This is expected to fix spurious errors for the following tests: - testMobildeDataAlwaysOn - testLingering - testPacketKeepAlive - testMMSonWiFi To fix the second issue, the deadlines for testRequestBenchmark are extended by 10ms. Also, the failure message is made more actionable by providing the total time it took for the operation, instead of printing the number of dispatches that were achieved before the deadline. Bug: 32561414 Test: tests pass many times in a row (~500). Change-Id: Id33c6ac1edfb0b89634fa7789dccb2da237e2709
Loading
Please register or sign in to comment