Add @retry to flaky calls in chameleon_test
DUT may be slow in discovering newly connected external display. Function
calls (e.g., get_external_connector_name()) to retrieve information of the
display may fail during the discovery. So far, the following errors (wrapped
in xmlrpclib.Fault) are observed in running various tests that make those
calls:
<type 'exceptions.KeyError'>:...
<type 'exceptions.IndexError'>:list index out of range
<class \'autotest_lib.client.common_lib.error.CmdError\'>:Command <DISPLAY=:0 XAUTHORITY=/home/chronos/.Xauthority xrandr > failed, rc=1, Command returned non-zero exit status
This patch adds @retry to these calls to make them robust.
The patch also fixed a bug in display_facade_adapter.wait_for_output() where
it doesn't return the result from the RPC call.
BUG=chromium:408376
TEST=run the following ChameleonTest continuously on nyan_big and squawks and
see errors being caught and the calls being re-tried:
class SimpleTest(chameleon_test.ChameleonTest):
def run_once(self, host):
self.reconnect_output()
self.set_mirrored(True)
Change-Id: Ia4966f45177fd9b562088837a052a5cbf38aeb2f
Reviewed-on: https://chromium-review.googlesource.com/226750
Tested-by: Hung-ying Tyan <tyanh@chromium.org>
Commit-Queue: Hung-ying Tyan <tyanh@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@chromium.org>
2 files changed