[test] Correctly retry connections on android targets
authorPavel Labath <labath@google.com>
Mon, 14 Mar 2016 15:33:25 +0000 (15:33 +0000)
committerPavel Labath <labath@google.com>
Mon, 14 Mar 2016 15:33:25 +0000 (15:33 +0000)
commit56673749d24a5e85e79d9b69bdd393ba625287ca
treef673b3ec9f847264b2798d45a347ff21f66168de
parent42db3ff47fccf3e38d4229e3dd1a4864b21321fe
[test] Correctly retry connections on android targets

Summary:
Normally, when the remote stub is not ready, we will get ECONNREFUSED during the connect()
attempt. However, due to the way how ADB forwarding works, on android targets the connect() will
always be successful, but the connection will be immediately dropped if ADB could not connect on
the remote side. This commit tries to detect this situation, and report it as "connection
refused" so that the upper test layers attempt the connection again.

Reviewers: tfiala, tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

Differential Revision: http://reviews.llvm.org/D18146

llvm-svn: 263439
lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py