Wait for broadcast idle instead of sleep
In most cases, this change will make this test run faster, as the device isn't processing a lot of broadcasts so the broadcast queue becomes idle much earlier than 5 seconds (tests on a Pixel 4A running AOSP indicate ~1 second). On low-end devices, this will give the device a better chance to actually pass the test in spite of high load. The drawback is that this will wait for the broadcast *queue* to be idle, so for all broadcasts to have been delivered to all apps, not just the one this test is interested in. To wit, there will be cases where this will increase the length of the test. But this should be a minority of cases. Test: atest ConnectivityDiagnosticsManagerTest Bug: 257412943 Change-Id: I84a8929635ee3a587ef2712a59323abe68fda31b
Loading
Please register or sign in to comment