Wait for start() to finish
Since start() triggers createFd(), it does need to wait for it to
complete. Otherwise, sendPing() might run before a socket has been
allocated.
Bug: 335824575
Test: TH
Change-Id: Ic65b691ea039c3cbbe99c792144f491c46c486b7
diff --git a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
index 9cda156..7a4d90b 100644
--- a/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
+++ b/tests/cts/net/src/android/net/cts/ApfIntegrationTest.kt
@@ -160,9 +160,9 @@
}
override fun start(): Boolean {
- // Ignore the fact start() could return false or throw an exception. There is also no
- // need to wait for start to be processed -- just post it on the handler and return.
+ // Ignore the fact start() could return false or throw an exception.
handler.post({ super.start() })
+ handler.waitForIdle(TIMEOUT_MS)
return true
}