diff options
| author | Mikko Rapeli <mikko.rapeli@linaro.org> | 2023-02-09 10:09:34 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-24 16:41:46 +0000 |
| commit | 90fd95edad5a08056490b99b8bb9b776cd46279a (patch) | |
| tree | 98d37803ae56f28c6e5281b7b091751cf221892a | |
| parent | 7f36239b4ed63d31cb1fba03c00320ffe7c173a0 (diff) | |
| download | poky-90fd95edad5a08056490b99b8bb9b776cd46279a.tar.gz | |
oeqa qemurunner.py: add timeout to QMP calls
When a qemu machine hangs, the QMP calls can hang for ever
too, and when this happens any failing test commands from ssh
runner may be followed by dump_monitor() calls which
then also hang. Hangs followed by hangs.
Use runqemutime at setup and run_monitor() specific timeout
for later calls.
(From OE-Core rev: 3b99d0ce6445084038f89dfa98605a7aec49107b)
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
(cherry picked from commit 3a07bdf77dc6ecbf4c620b051dd032abaaf1e4ff)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index fedabb189a..aa9e530f1b 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
| @@ -342,6 +342,8 @@ class QemuRunner: | |||
| 342 | return False | 342 | return False |
| 343 | 343 | ||
| 344 | try: | 344 | try: |
| 345 | # set timeout value for all QMP calls | ||
| 346 | self.qmp.settimeout(self.runqemutime) | ||
| 345 | self.qmp.connect() | 347 | self.qmp.connect() |
| 346 | connect_time = time.time() | 348 | connect_time = time.time() |
| 347 | self.logger.info("QMP connected to QEMU at %s and took %s seconds" % | 349 | self.logger.info("QMP connected to QEMU at %s and took %s seconds" % |
| @@ -617,6 +619,7 @@ class QemuRunner: | |||
| 617 | 619 | ||
| 618 | def run_monitor(self, command, args=None, timeout=60): | 620 | def run_monitor(self, command, args=None, timeout=60): |
| 619 | if hasattr(self, 'qmp') and self.qmp: | 621 | if hasattr(self, 'qmp') and self.qmp: |
| 622 | self.qmp.settimeout(timeout) | ||
| 620 | if args is not None: | 623 | if args is not None: |
| 621 | return self.qmp.cmd(command, args) | 624 | return self.qmp.cmd(command, args) |
| 622 | else: | 625 | else: |
