summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2020-05-01 07:23:38 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-01 07:23:38 +0000
commit5e3fdc1c31ebb52360a119a2adb1057ddbd86ef8 (patch)
treefb6c47890dff97e1a2811639aeb783c48f5953da
parentd4de86b4163938c278c2be9e0f2e6e74c58eacd3 (diff)
parent0162c4fc80cb3316d010254371f36ef0bc10f02a (diff)
Merge "Wait for IpClient.StoppedState#enter before tests" into rvc-dev am: b91dc8229c am: 0162c4fc80
Change-Id: Iba35fddbeaf7187425573ee61ccb7f51876b6f6a
-rw-r--r--tests/integration/src/android/net/ip/IpClientIntegrationTest.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/integration/src/android/net/ip/IpClientIntegrationTest.java b/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
index 4210619..225f598 100644
--- a/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
+++ b/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
@@ -449,6 +449,11 @@ public class IpClientIntegrationTest {
mNetworkObserverRegistry.register(mNetd);
mIpc = new IpClient(mContext, mIfaceName, mCb, mNetworkObserverRegistry,
mNetworkStackServiceManager, mDependencies);
+ // Wait for IpClient to enter its initial state. Otherwise, additional setup steps or tests
+ // that mock IpClient's dependencies might interact with those mocks while IpClient is
+ // starting. This would cause UnfinishedStubbingExceptions as mocks cannot be interacted
+ // with while they are being stubbed.
+ HandlerUtilsKt.waitForIdle(mIpc.getHandler(), TEST_TIMEOUT_MS);
// Tell the IpMemoryStore immediately to answer any question about network attributes with a
// null response. Otherwise, the DHCP client will wait for two seconds before starting,