Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a2fec5e authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Increase timeout of ActivityMetricsLaunchObserverTests

The test is flaky due to the message is not handled in a short time.
Especially the testing device may not be fast and there could have
other messages in the queue, e.g. in setUpAMLO, registerLaunchObserver
also sends message to the same handler.

Bug: 129138370
Test: atest ActivityMetricsLaunchObserverTests
Change-Id: I67a1d3bb1e0efb014cd443e84313d1a90010ac4c
parent 4448c1df
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import org.junit.Test;
import org.mockito.ArgumentMatcher;

import java.util.Arrays;
import java.util.concurrent.TimeUnit;

/**
 * Tests for the {@link ActivityMetricsLaunchObserver} class.
@@ -118,7 +119,7 @@ public class ActivityMetricsLaunchObserverTests extends ActivityTestsBase {

    static <T> T verifyAsync(T mock) {
        // AMLO callbacks happen on a separate thread than AML calls, so we need to use a timeout.
        return verify(mock, timeout(100));
        return verify(mock, timeout(TimeUnit.SECONDS.toMillis(5)));
    }

    @Test