qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM
@ 2024-01-17  4:25 Ani Sinha
  2024-01-17  9:43 ` Daniel P. Berrangé
  0 siblings, 1 reply; 3+ messages in thread
From: Ani Sinha @ 2024-01-17  4:25 UTC (permalink / raw)
  To: Ani Sinha, Michael S. Tsirkin, Cleber Rosa,
	Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
	Beraldo Leal
  Cc: peter.maydell, qemu-devel

By default, the timeout to receive any specified event from the QEMU VM is 60
seconds set by the python avocado test framework. Please see event_wait() and
events_wait() in python/qemu/machine/machine.py. If the matching event is not
triggered within that interval, an asyncio.TimeoutError is generated. Since the
timeout for the bits avocado test is 200 secs, we need to make event_wait()
timeout of the same value as well so that an early timeout is not triggered by
the avocado framework.

CC: peter.maydell@linaro.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2077
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
 tests/avocado/acpi-bits.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

changelog:
v2: cosmetic comment updates in code and patch description.

diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py
index 68b9e98d4e..efe4f52ee0 100644
--- a/tests/avocado/acpi-bits.py
+++ b/tests/avocado/acpi-bits.py
@@ -54,6 +54,8 @@
 deps = ["xorriso", "mformat"] # dependent tools needed in the test setup/box.
 supported_platforms = ['x86_64'] # supported test platforms.
 
+# default timeout of 120 secs is sometimes not enough for bits test.
+BITS_TIMEOUT = 200
 
 def which(tool):
     """ looks up the full path for @tool, returns None if not found
@@ -133,7 +135,7 @@ class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes
 
     """
     # in slower systems the test can take as long as 3 minutes to complete.
-    timeout = 200
+    timeout = BITS_TIMEOUT
 
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
@@ -400,7 +402,8 @@ def test_acpi_smbios_bits(self):
 
         # biosbits has been configured to run all the specified test suites
         # in batch mode and then automatically initiate a vm shutdown.
-        # Rely on avocado's unit test timeout.
-        self._vm.event_wait('SHUTDOWN')
+        # Set timeout to BITS_TIMEOUT for SHUTDOWN event from bits VM at par
+        # with the avocado test timeout.
+        self._vm.event_wait('SHUTDOWN', timeout=BITS_TIMEOUT)
         self._vm.wait(timeout=None)
         self.parse_log()
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM
  2024-01-17  4:25 [PATCH v2] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM Ani Sinha
@ 2024-01-17  9:43 ` Daniel P. Berrangé
  2024-01-19  9:58   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrangé @ 2024-01-17  9:43 UTC (permalink / raw)
  To: Ani Sinha
  Cc: Michael S. Tsirkin, Cleber Rosa, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal, peter.maydell,
	qemu-devel

On Wed, Jan 17, 2024 at 09:55:56AM +0530, Ani Sinha wrote:
> By default, the timeout to receive any specified event from the QEMU VM is 60
> seconds set by the python avocado test framework. Please see event_wait() and
> events_wait() in python/qemu/machine/machine.py. If the matching event is not
> triggered within that interval, an asyncio.TimeoutError is generated. Since the
> timeout for the bits avocado test is 200 secs, we need to make event_wait()
> timeout of the same value as well so that an early timeout is not triggered by
> the avocado framework.
> 
> CC: peter.maydell@linaro.org
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2077
> Signed-off-by: Ani Sinha <anisinha@redhat.com>
> ---
>  tests/avocado/acpi-bits.py | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> changelog:
> v2: cosmetic comment updates in code and patch description.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM
  2024-01-17  9:43 ` Daniel P. Berrangé
@ 2024-01-19  9:58   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2024-01-19  9:58 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Ani Sinha, Michael S. Tsirkin, Cleber Rosa,
	Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
	Beraldo Leal, qemu-devel

On Wed, 17 Jan 2024 at 09:43, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Wed, Jan 17, 2024 at 09:55:56AM +0530, Ani Sinha wrote:
> > By default, the timeout to receive any specified event from the QEMU VM is 60
> > seconds set by the python avocado test framework. Please see event_wait() and
> > events_wait() in python/qemu/machine/machine.py. If the matching event is not
> > triggered within that interval, an asyncio.TimeoutError is generated. Since the
> > timeout for the bits avocado test is 200 secs, we need to make event_wait()
> > timeout of the same value as well so that an early timeout is not triggered by
> > the avocado framework.
> >
> > CC: peter.maydell@linaro.org
> > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2077
> > Signed-off-by: Ani Sinha <anisinha@redhat.com>
> > ---
> >  tests/avocado/acpi-bits.py | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > changelog:
> > v2: cosmetic comment updates in code and patch description.
>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Thanks; I've applied this directly. Hopefully it will deal with
this intermittent for good.

-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-19  9:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17  4:25 [PATCH v2] acpi/tests/avocado/bits: wait for 200 seconds for SHUTDOWN event from bits VM Ani Sinha
2024-01-17  9:43 ` Daniel P. Berrangé
2024-01-19  9:58   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).