From 5f01cb924615336a5ea5cf2289cfd44ecb821516 Mon Sep 17 00:00:00 2001 From: Richard Uhler Date: Thu, 5 Sep 2019 17:39:12 +0100 Subject: Increase timeout in testNativeWatchdogTriggersRollback Bumps a timeout from 1 minute to 5 minutes, because in practice a lot more needs to happen in that time window than we expect to fit in 1 minute. Bug: 140223710 Test: atest StagedRollbackTest:com.android.tests.rollback.host.StagedRollbackTest#testNativeWatchdogTriggersRollback Change-Id: I2e937f8e1f87356815a834241ad5e9ec1e953892 Merged-In: I2a98e71102fc1cbf6ea712e070d6db49cdb05cba --- .../android/tests/rollback/host/StagedRollbackTest.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java index 244f958067d5..f74aaf3bb865 100644 --- a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java +++ b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java @@ -29,6 +29,8 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import java.util.concurrent.TimeUnit; + /** * Runs the staged rollback tests. */ @@ -100,9 +102,15 @@ public class StagedRollbackTest extends BaseHostJUnit4Test { // crash system_server enough times to trigger a rollback crashProcess("system_server", NATIVE_CRASHES_THRESHOLD); - // Rollback should be committed automatically now - // Give time for rollback to be committed - assertTrue(getDevice().waitForDeviceNotAvailable(60000)); + // Rollback should be committed automatically now. + // Give time for rollback to be committed. This could take a while, + // because we need all of the following to happen: + // 1. system_server comes back up and boot completes. + // 2. Rollback health observer detects updatable crashing signal. + // 3. Staged rollback session becomes ready. + // 4. Device actually reboots. + // So we give a generous timeout here. + assertTrue(getDevice().waitForDeviceNotAvailable(TimeUnit.MINUTES.toMillis(5))); getDevice().waitForDeviceAvailable(); // verify rollback committed -- cgit v1.2.3-59-g8ed1b