summaryrefslogtreecommitdiff
path: root/tests/AppLaunch
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2018-03-08 18:12:46 -0800
committerMathieu Chartier <mathieuc@google.com>2018-03-08 18:30:06 -0800
commit505511c8290e8815fa6d8b69dead08d71e347e7b (patch)
tree002b5e3cd28a2d67168d3dd40357c3df736468bf /tests/AppLaunch
parent0aa191ccbf159b0d6127cfc190e2c4d5fa319eb9 (diff)
Add sleep for profile saving in AppLaunch
Aim to prevent cases where the profile won't be saved when we compile. Bug: 70734839 Test: m Change-Id: Ib6f8740c70729914fc559f249b19adea1e7777f0
Diffstat (limited to 'tests/AppLaunch')
-rw-r--r--tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
index 494ee6594492..f4b85b209e4f 100644
--- a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
+++ b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
@@ -92,6 +92,7 @@ public class AppLaunch extends InstrumentationTestCase {
private static final int INITIAL_LAUNCH_IDLE_TIMEOUT = 5000; // 5s to allow app to idle
private static final int POST_LAUNCH_IDLE_TIMEOUT = 750; // 750ms idle for non initial launches
private static final int BETWEEN_LAUNCH_SLEEP_TIMEOUT = 5000; // 5s between launching apps
+ private static final int PROFILE_SAVE_SLEEP_TIMEOUT = 1000; // Allow 1s for the profile to save
private static final String LAUNCH_SUB_DIRECTORY = "launch_logs";
private static final String LAUNCH_FILE = "applaunch.txt";
private static final String TRACE_SUB_DIRECTORY = "atrace_logs";
@@ -263,6 +264,8 @@ public class AppLaunch extends InstrumentationTestCase {
String.format("killall -s SIGUSR1 %s", appPkgName);
getInstrumentation().getUiAutomation().executeShellCommand(
sendSignalCommand);
+ // killall is async, wait one second to let the app save the profile.
+ sleep(PROFILE_SAVE_SLEEP_TIMEOUT);
assertTrue(String.format("Not able to compile the app : %s", appPkgName),
compileApp(launch.getCompilerFilter(), appPkgName));
}