summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2020-05-01 06:55:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-05-01 06:55:19 +0000
commitb91dc8229ccbb444a0ee77939485556e64873890 (patch)
tree2c5fec509aad1f41f1dc55f3c42a855e75d2ae49
parent9d5175317630e14c2f76de6d6f273609a46a4b76 (diff)
parent87b5dd44da352123fd0cbc3cd2350ce95d817be4 (diff)
Merge "Wait for IpClient.StoppedState#enter before tests" into rvc-dev
-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,