summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2020-04-26 11:46:38 +0000
committerLorenzo Colitti <lorenzo@google.com>2020-04-26 12:04:09 +0000
commit088567c8be4de935cde1bcdf455a38854c715d68 (patch)
tree8739f0369643d04816ebef173713bffd0565cfee
parent23013b08caa51f26606ad7b90c321b243e7c5e83 (diff)
Speed up the DHCP roaming tests.
The DHCP roaming tests all call doDhcpRoamingTest. This method appears to want to have the IpMemoryStore return null, but instead just causes DhcpClient's IpMemoryStore query to time out. Fix this by actually calling the onNetworkAttributesRetrieved callback with null. Before: real 0m43.728s After: real 0m38.660s Bug: 152723363 Test: atest NetworkStackNextIntegrationTests Original-Change: http://aosp/1295489 Merged-In: I6fc93f82fda6891b3973d04e30cdfce6563077a1 Change-Id: I6fc93f82fda6891b3973d04e30cdfce6563077a1
-rw-r--r--tests/integration/src/android/net/ip/IpClientIntegrationTest.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/integration/src/android/net/ip/IpClientIntegrationTest.java b/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
index 5ae4470..c2df5ab 100644
--- a/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
+++ b/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
@@ -1946,6 +1946,9 @@ public class IpClientIntegrationTest {
doAnswer(invocation -> {
// we don't rely on the Init-Reboot state to renew previous cached IP lease.
// Just return null and force state machine enter INIT state.
+ final String l2Key = invocation.getArgument(0);
+ ((OnNetworkAttributesRetrievedListener) invocation.getArgument(1))
+ .onNetworkAttributesRetrieved(new Status(SUCCESS), l2Key, null);
return null;
}).when(mIpMemoryStore).retrieveNetworkAttributes(eq(TEST_L2KEY), any());