diff options
| author | 2019-09-27 17:13:14 +0900 | |
|---|---|---|
| committer | 2019-09-27 21:44:54 +0900 | |
| commit | b299b8418fa49ef8c950d25caf663ba27a5809ab (patch) | |
| tree | 90b75b4c06f5cd97e4185e16b48c1bc19c993b88 | |
| parent | 5d8d5f9af7fe035d3eab91f8cd4184c3fe986373 (diff) | |
Decrease load-related flakiness in ConnectivityServiceTest
Almost always this timeout is not waited anyway.
Test: ConnectivityServiceTest
Change-Id: I74376633d0ec8d93fb48609a4df73cad5fc5d508
| -rw-r--r-- | tests/net/java/com/android/server/ConnectivityServiceTest.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java index 9e21db76be84..5bfd647f0152 100644 --- a/tests/net/java/com/android/server/ConnectivityServiceTest.java +++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java @@ -258,13 +258,13 @@ public class ConnectivityServiceTest { private static final String TAG = "ConnectivityServiceTest"; private static final int TIMEOUT_MS = 500; - private static final int TEST_LINGER_DELAY_MS = 250; + private static final int TEST_LINGER_DELAY_MS = 300; // Chosen to be less than the linger timeout. This ensures that we can distinguish between a // LOST callback that arrives immediately and a LOST callback that arrives after the linger // timeout. For this, our assertions should run fast enough to leave less than // (mService.mLingerDelayMs - TEST_CALLBACK_TIMEOUT_MS) between the time callbacks are // supposedly fired, and the time we call expectCallback. - private static final int TEST_CALLBACK_TIMEOUT_MS = 200; + private static final int TEST_CALLBACK_TIMEOUT_MS = 250; // Chosen to be less than TEST_CALLBACK_TIMEOUT_MS. This ensures that requests have time to // complete before callbacks are verified. private static final int TEST_REQUEST_TIMEOUT_MS = 150; @@ -1466,6 +1466,10 @@ public class ConnectivityServiceTest { * received. assertNoCallback may be called at any time. */ private class TestNetworkCallback extends TestableNetworkCallback { + TestNetworkCallback() { + super(TEST_CALLBACK_TIMEOUT_MS); + } + @Override public void assertNoCallback() { // TODO: better support this use case in TestableNetworkCallback |