summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2019-02-07 17:53:29 -0800
committerJosh Gao <jmgao@google.com>2019-02-07 17:53:29 -0800
commitaa95aa063fb0c7069b32f091bbce723da2761fcc (patch)
treef28a68e8734b8c46a8b6032eaeb351d8566b4552
parent3dbdf65afcc532ee330ebdba3a8555726d6d521b (diff)
adb: hopefully deflake test_adb.py.
The reconnection test is spuriously failing on test infrastructure for unclear reasons, which might be due to a race between the connection attempt and the first command we send. Insert a sleep to hopefully reduce the flakiness. Bug: http://b/123247844 Test: ./test_adb.py (but it didn't fail for me in the first place) Change-Id: Ic36924c16bae424accfec700af4623794fd1f123
-rwxr-xr-xadb/test_adb.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/adb/test_adb.py b/adb/test_adb.py
index 430fc3d85..14e5071fb 100755
--- a/adb/test_adb.py
+++ b/adb/test_adb.py
@@ -422,6 +422,9 @@ class ConnectionTest(unittest.TestCase):
with fake_adbd() as (port, _):
serial = "localhost:{}".format(port)
with adb_connect(self, serial):
+ # Wait a bit to give adb some time to connect.
+ time.sleep(0.25)
+
output = subprocess.check_output(["adb", "-s", serial,
"get-state"])
self.assertEqual(output.strip(), b"device")