From 580909db4904aeedf10d4cf1a05d783e8d963df6 Mon Sep 17 00:00:00 2001 From: Yan Han Date: Wed, 15 Sep 2021 15:18:22 +0200 Subject: [PATCH] Round 3: Fix flakiness of testNativeCrash Round 2: ag/15616233 Round 1: aosp/1702009 Even with increased timeouts, testNativeCrash is not always able to get the tombstone of the crashed native app. This is because the tombstone timestamp can be more than 1000ms before the ApplicationExitInfo, causing them to not match. See b/191798394 for more details. This CL increases the maximum timestamp difference to ensure that the tombstone (almost?) always matches. Bug: 192299487 Test: atest android.app.cts.ActivityManagerAppExitInfoTest Change-Id: Ideeb93dbcb40ce9d564f159fe1f7574554c09a40 --- .../core/java/com/android/server/os/NativeTombstoneManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/os/NativeTombstoneManager.java b/services/core/java/com/android/server/os/NativeTombstoneManager.java index ed1f5f567d955..3fc416931a06f 100644 --- a/services/core/java/com/android/server/os/NativeTombstoneManager.java +++ b/services/core/java/com/android/server/os/NativeTombstoneManager.java @@ -356,7 +356,7 @@ public final class NativeTombstoneManager { return false; } - if (Math.abs(exitInfo.getTimestamp() - mTimestampMs) > 1000) { + if (Math.abs(exitInfo.getTimestamp() - mTimestampMs) > 5000) { return false; }