HapClientTest: Fix flaky test caused by onReceive call after tearDown
Even if mHasIntentReceiver is unregistered in tearDown it can be called, which cause fatal exception as other variables was cleared. Add wait for onReceive callback in test cases. These two tests are fix with that: testDumpDoesNotCrash, testOutgoingConnectExistingHasUuid Test testStackEventOnPresetNameSetError was false negativ because test testOutgoingConnectExistingHasUuid which was previous of this one trigger late call of onReceive during this test. Bug: 320205015 Test: atest com.android.bluetooth.hap.HapClientTest#testDumpDoesNotCrash,testOutgoingConnectExistingHasUuid --rerun-until-failure Flag: Exempt, unit test flaky fix Change-Id: I843a07cf7a54a76da8b2dd8cae70787db425d382
Loading
Please register or sign in to comment