summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2018-12-11 00:05:32 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-12-11 00:05:32 -0800
commit0d5028b3efa3fcc4d117843804e8c21d6e6c3ba6 (patch)
tree27450f93a2fb15e76d92b14ac0bd2a5af3921309
parent3a0e9f2863696f3316400102f39ad4c9caccb395 (diff)
parent2eacd483279af9c2296d7aea99594ce3425d5d7d (diff)
downloadtests-0d5028b3efa3fcc4d117843804e8c21d6e6c3ba6.tar.gz
anycast_test.py: change to use thread.join to wait CloseFileDescriptorThread finished
am: 2eacd48327 Change-Id: Ie1a602345016d79e8da0fab23bd07583603850cf
-rwxr-xr-xnet/test/anycast_test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/test/anycast_test.py b/net/test/anycast_test.py
index 82130db..62d874e 100755
--- a/net/test/anycast_test.py
+++ b/net/test/anycast_test.py
@@ -93,7 +93,9 @@ class AnycastTest(multinetwork_base.MultiNetworkBaseTest):
# This will hang if the kernel has the bug.
thread = CloseFileDescriptorThread(self.tuns[netid])
thread.start()
- time.sleep(0.1)
+ # Wait up to 0.5 seconds for the thread to finish, but
+ # continue and fail the test if the thread hangs.
+ thread.join(0.5)
# Make teardown work.
del self.tuns[netid]