[otci] wait for 2 seconds before retrying a command (#7995)

After a factoryreset the `ot-ctl` may fail to connect to the socket
for ~10 seconds. In such a situation, if OTCI sends a new command,
`execute_command` will receive an exception and will retry the same
command for several times. Such retries will immediately fail because
`ot-ctl` connection is still down and there's no time gap between two
retries.  Hence we should add some wait time before retrying so that
it gives `ot-ctl` some time to recover the connection.
This commit is contained in:
whd
2022-08-08 09:14:33 -07:00
committed by GitHub
parent b2f8c4adba
commit 24fd146e10
+1
View File
@@ -101,6 +101,7 @@ class OTCI(object):
try:
return self.__execute_command(cmd, timeout, silent, already_is_ok=already_is_ok)
except Exception:
self.wait(2)
if i == self.__exec_command_retry:
raise