Adding debug tracing for Device.wait

I suspect it may wait for a period of time less than
the specified one, causing flakes.

Test: presubmit
Bug: 177318681
Change-Id: I0be8790c6ee9a5831767fe83c36054ed5a84f8d7
This commit is contained in:
vadimt
2021-01-15 13:58:03 -08:00
parent 4318289207
commit ed86cb19bc
5 changed files with 20 additions and 8 deletions

View File

@@ -237,7 +237,7 @@ public abstract class AbstractLauncherUiTest {
@Before
public void setUp() throws Exception {
Assert.assertTrue("Keyguard is visible",
mDevice.wait(
TestHelpers.wait(
Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000));
final String launcherPackageName = mDevice.getLauncherPackageName();
@@ -470,8 +470,7 @@ public abstract class AbstractLauncherUiTest {
}
getInstrumentation().getTargetContext().startActivity(intent);
assertTrue("App didn't start: " + selector,
UiDevice.getInstance(getInstrumentation())
.wait(Until.hasObject(selector), DEFAULT_UI_TIMEOUT));
TestHelpers.wait(Until.hasObject(selector), DEFAULT_UI_TIMEOUT));
}
public static ActivityInfo resolveSystemAppInfo(String category) {