From: Mariano Lopez <[email protected]> Sometmes when there is high load in the server the commands executed in the target take a lot of time to complete and this lead to incorrect dump files or empty files. This is caused because run_serial has a timeout of five seconds when running the commands in the target.
This change removes the timeout and just keep reading the socket until it finds the prompt from the target or when the socket is not ready to be read. [YOCTO #8510] Signed-off-by: Mariano Lopez <[email protected]> --- meta/lib/oeqa/utils/qemurunner.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index bdc6e0a..e1e4057 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -366,23 +366,25 @@ class QemuRunner: # We assume target system have echo to get command status if not raw: command = "%s; echo $?\n" % command - self.server_socket.sendall(command) + data = '' status = 0 - stopread = False - endtime = time.time()+5 - while time.time()<endtime and not stopread: + self.server_socket.sendall(command) + keepreading = True + while keepreading: sread, _, _ = select.select([self.server_socket],[],[],5) - for sock in sread: - answer = sock.recv(1024) + if sread: + answer = self.server_socket.recv(1024) if answer: data += answer # Search the prompt to stop if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data): - stopread = True - break + keepreading = False else: raise Exception("No data on serial console socket") + else: + keepreading = False + if data: if raw: status = 1 -- 1.8.4.5 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
