diff mbox series

[PULL,2/3] tests/avocado: add timeout to the aspeed tests

Message ID 20220816122621.2066292-3-alex.bennee@linaro.org
State Accepted
Commit b1ceae2f5bc477217dd292bffa7b4abb34d78a2b
Headers show
Series [PULL,1/3] linux-user: un-parent OBJECT(cpu) when closing thread | expand

Commit Message

Alex Bennée Aug. 16, 2022, 12:26 p.m. UTC
On some systems the test can hang. At least defining a timeout stops
it from hanging forever.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220811151413.3350684-7-alex.bennee@linaro.org>

Comments

Peter Maydell Aug. 16, 2022, 12:32 p.m. UTC | #1
On Tue, 16 Aug 2022 at 13:26, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> On some systems the test can hang. At least defining a timeout stops
> it from hanging forever.

Aha. Yeah, I've seen this test hang forever sometimes.

Is there some place (in the superclass??) that we can put a
default timeout that applies to *all* avocado tests, so we
don't have the risk of forgetting it in a particular test?

-- PMM
Alex Bennée Aug. 16, 2022, 1:31 p.m. UTC | #2
Peter Maydell <peter.maydell@linaro.org> writes:

> On Tue, 16 Aug 2022 at 13:26, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> On some systems the test can hang. At least defining a timeout stops
>> it from hanging forever.
>
> Aha. Yeah, I've seen this test hang forever sometimes.
>
> Is there some place (in the superclass??) that we can put a
> default timeout that applies to *all* avocado tests, so we
> don't have the risk of forgetting it in a particular test?

It's a bit muddy. Most tests are sub-classed on LinuxTest which does
define a default timeout:

  class LinuxTest(LinuxSSHMixIn, QemuSystemTest):
      """Facilitates having a cloud-image Linux based available.

      For tests that indent to interact with guests, this is a better choice
      to start with than the more vanilla `QemuSystemTest` class.
      """

      timeout = 900
      distro = None
      username = 'root'
      password = 'password'
      smp = '2'
      memory = '1024'

However the aspeed tests are directly derived from QemuSystemTest.
Perhaps we should just move the timeout down to that or maybe
QemuBaseTest?

>
> -- PMM
Peter Maydell Aug. 16, 2022, 1:40 p.m. UTC | #3
On Tue, 16 Aug 2022 at 14:34, Alex Bennée <alex.bennee@linaro.org> wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
> > Is there some place (in the superclass??) that we can put a
> > default timeout that applies to *all* avocado tests, so we
> > don't have the risk of forgetting it in a particular test?
>
> It's a bit muddy. Most tests are sub-classed on LinuxTest which does
> define a default timeout:
>
>   class LinuxTest(LinuxSSHMixIn, QemuSystemTest):
>       """Facilitates having a cloud-image Linux based available.
>
>       For tests that indent to interact with guests, this is a better choice
>       to start with than the more vanilla `QemuSystemTest` class.
>       """
>
>       timeout = 900
>       distro = None
>       username = 'root'
>       password = 'password'
>       smp = '2'
>       memory = '1024'
>
> However the aspeed tests are directly derived from QemuSystemTest.
> Perhaps we should just move the timeout down to that or maybe
> QemuBaseTest?

Ideally, we should do it at whatever level ensures it is applied
to every single test that 'check-avocado' runs, regardless of how
the test was written. "QemuBaseTest" still sounds a bit higher
than the absolute basic "this is a test" level, but maybe that's
the lowest level we have access to?

thanks
-- PMM
diff mbox series

Patch

diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
index b4e35a3d07..c54da0fd8f 100644
--- a/tests/avocado/machine_aspeed.py
+++ b/tests/avocado/machine_aspeed.py
@@ -40,6 +40,8 @@  def test_ast1030_zephyros(self):
 
 class AST2x00Machine(QemuSystemTest):
 
+    timeout = 90
+
     def wait_for_console_pattern(self, success_message, vm=None):
         wait_for_console_pattern(self, success_message,
                                  failure_message='Kernel panic - not syncing',