diff mbox series

[dunfell,13/14] oeqa/target/ssh: Ensure EAGAIN doesn't truncate output

Message ID 605d832e86f249100adaf3761b4e1701401d0b76.1694526588.git.steve@sakoman.com
State Accepted, archived
Commit 605d832e86f249100adaf3761b4e1701401d0b76
Headers show
Series [dunfell,01/14] bind: Backport fix for CVE-2023-2828 | expand

Commit Message

Steve Sakoman Sept. 12, 2023, 1:53 p.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

We have a suspicion that the read() call may return EAGAIN on the non-blocking
fd and this may truncate test output leading to some of our intermittent failures.
Tweak the code to avoid this potential issue.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a8920c105725431e989cceb616bd04eaa52127ec)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/lib/oeqa/core/target/ssh.py | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index af4a67f266..832b6216f6 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -226,6 +226,9 @@  def SSHCall(command, logger, timeout=None, **opts):
                             endtime = time.time() + timeout
                 except InterruptedError:
                     continue
+                except BlockingIOError:
+                    logger.debug('BlockingIOError')
+                    continue
 
             # process hasn't returned yet
             if not eof: