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
<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.

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):

Change-Id: Ia4966f45177fd9b562088837a052a5cbf38aeb2f
Tested-by: Hung-ying Tyan <>
Commit-Queue: Hung-ying Tyan <>
Reviewed-by: Wai-Hong Tam <>
2 files changed