From 47bcb2b6c504d783cd3f7fb1c496cec94bc3ca8e Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Tue, 14 Nov 2023 10:16:05 -0800 Subject: [PATCH] Increasing wait time for Launcher restart after enabling test provider Of the the logcats indicates that Launcher gets killed eventually, but it takes 17 sec, while the test waits for the Launcher restart to compete in 10 sec. Perhaps restart take longer than usual because the system is still busy killing setup wizard. This is the second attempt to land this CL; the first one was reverted because the revert author believed this breaks their tests. This time I'm icreasing the wait from 10 to 30 (not 60) secs. Bug: 308489613 Test: presubmit Flag: N/A Change-Id: I18cff219cf6ec2732ed181c970cb5315bf568cab --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index e30885b2a8..a60dba7fb2 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -273,11 +273,11 @@ public final class LauncherInstrumentation { mDevice.executeShellCommand( "pm enable --user " + userId + " " + cn.flattenToString()); // Wait for Launcher restart after enabling test provider. - for (int i = 0; i < 100; ++i) { + for (int i = 0; i < 300; ++i) { final String currentPid = mDevice.executeShellCommand(launcherPidCommand) .replaceAll("\\s", ""); if (!currentPid.isEmpty() && !currentPid.equals(initialPid)) break; - if (i == 99) fail("Launcher didn't restart after enabling test provider"); + if (i == 299) fail("Launcher didn't restart after enabling test provider"); SystemClock.sleep(100); } } catch (IOException e) {