CtsPrintTestCases: Finish closing activity before recreating
When selecting a default printer, BasePrintTest submits a print job,
closes the activity, and recreates the test activity. However, it
doesn't wait for the activity to be completely gone, so it may be
possible for an immediately following UiDevice.findObject to return a
reference to the activity being destroyed.
By switching to the existing function that waits for the activity to be
fully destroyed, this race should no longer be possible. This is a
speculative fix for some flakes in InterfaceForAppsTest.
Bug: 365379344
Test: atest --iterations 100 CtsPrintTestCases_Presubmit:android.print.cts.InterfaceForAppsTest
Change-Id: Ib0fd24060900c51aa29cffa8cd65da8971666c4b
1 file changed