diff mbox series

tests/acceptance/boot_linux: Skip slow Aarch64 'virt' machine TCG test

Message ID 20200507162235.1790-1-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests/acceptance/boot_linux: Skip slow Aarch64 'virt' machine TCG test | expand

Commit Message

Philippe Mathieu-Daudé May 7, 2020, 4:22 p.m. UTC
The BootLinuxAarch64.test_virt_tcg is reported to take >7min to run.
Add a possibility to users to skip this particular test, by setting
the AVOCADO_SKIP_SLOW_TESTS environment variable:

  $ AVOCADO_SKIP_SLOW_TESTS=please make check-acceptance
  ...
    (05/88) tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg: SKIP: Test takes >7min
  ...

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/boot_linux.py | 2 ++
 1 file changed, 2 insertions(+)

Comments

Alex Bennée May 7, 2020, 6:38 p.m. UTC | #1
Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> The BootLinuxAarch64.test_virt_tcg is reported to take >7min to run.
> Add a possibility to users to skip this particular test, by setting
> the AVOCADO_SKIP_SLOW_TESTS environment variable:
>
>   $ AVOCADO_SKIP_SLOW_TESTS=please make check-acceptance
>   ...
>     (05/88) tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg: SKIP: Test takes >7min
>   ...

7m = 420s - I'm seeing:

  hyperfine "./tests/venv/bin/avocado run ./tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg"
  Benchmark #1: ./tests/venv/bin/avocado run ./tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg
    Time (mean ± σ):     162.179 s ±  3.138 s    [User: 204.726 s, System: 9.663 s]
    Range (min … max):   158.651 s … 170.036 s    10 runs

Is this on very slow hardware?


>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/acceptance/boot_linux.py | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py
> index 075a386300..a8df50d769 100644
> --- a/tests/acceptance/boot_linux.py
> +++ b/tests/acceptance/boot_linux.py
> @@ -15,6 +15,7 @@
>  from qemu.accel import kvm_available
>  from qemu.accel import tcg_available
>  
> +from avocado import skipIf
>  from avocado.utils import cloudinit
>  from avocado.utils import network
>  from avocado.utils import vmimage
> @@ -159,6 +160,7 @@ def add_common_args(self):
>          self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
>          self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')
>  
> +    @skipIf(os.getenv('AVOCADO_SKIP_SLOW_TESTS'), 'Test takes >7min')
>      def test_virt_tcg(self):
>          """
>          :avocado: tags=accel:tcg
Peter Maydell May 7, 2020, 6:45 p.m. UTC | #2
On Thu, 7 May 2020 at 19:38, Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>
> > The BootLinuxAarch64.test_virt_tcg is reported to take >7min to run.
> > Add a possibility to users to skip this particular test, by setting
> > the AVOCADO_SKIP_SLOW_TESTS environment variable:
> >
> >   $ AVOCADO_SKIP_SLOW_TESTS=please make check-acceptance
> >   ...
> >     (05/88) tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg: SKIP: Test takes >7min
> >   ...
>
> 7m = 420s - I'm seeing:
>
>   hyperfine "./tests/venv/bin/avocado run ./tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg"
>   Benchmark #1: ./tests/venv/bin/avocado run ./tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg
>     Time (mean ± σ):     162.179 s ±  3.138 s    [User: 204.726 s, System: 9.663 s]
>     Range (min … max):   158.651 s … 170.036 s    10 runs
>
> Is this on very slow hardware?

Intel(R) Xeon(R) W-2145 CPU @ 3.70GHz 16-core
clang sanitizer build, which probably slows it down a bit.

But even 200 seconds is an order of magnitude slower than any
of the other tests that check-acceptance runs. I think we
should be aiming for tests here to be ~30 seconds at most,
or the whole thing will take forever by the time we have
decent coverage of most machines.

thanks
-- PMM
Alex Bennée May 7, 2020, 8:32 p.m. UTC | #3
Peter Maydell <peter.maydell@linaro.org> writes:

> On Thu, 7 May 2020 at 19:38, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>>
>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>>
>> > The BootLinuxAarch64.test_virt_tcg is reported to take >7min to run.
>> > Add a possibility to users to skip this particular test, by setting
>> > the AVOCADO_SKIP_SLOW_TESTS environment variable:
>> >
>> >   $ AVOCADO_SKIP_SLOW_TESTS=please make check-acceptance
>> >   ...
>> >     (05/88) tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg: SKIP: Test takes >7min
>> >   ...
>>
>> 7m = 420s - I'm seeing:
>>
>>   hyperfine "./tests/venv/bin/avocado run ./tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg"
>>   Benchmark #1: ./tests/venv/bin/avocado run ./tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg
>>     Time (mean ± σ):     162.179 s ±  3.138 s    [User: 204.726 s, System: 9.663 s]
>>     Range (min … max):   158.651 s … 170.036 s    10 runs
>>
>> Is this on very slow hardware?
>
> Intel(R) Xeon(R) W-2145 CPU @ 3.70GHz 16-core
> clang sanitizer build, which probably slows it down a bit.
>
> But even 200 seconds is an order of magnitude slower than any
> of the other tests that check-acceptance runs. I think we
> should be aiming for tests here to be ~30 seconds at most,
> or the whole thing will take forever by the time we have
> decent coverage of most machines.

I think we could say the same for a whole bunch of the tests that are
based on full distro downloads. What is this one running under the hood
anyway?


>
> thanks
> -- PMM
Philippe Mathieu-Daudé May 8, 2020, 1:07 p.m. UTC | #4
On 5/7/20 10:32 PM, Alex Bennée wrote:
> 
> Peter Maydell <peter.maydell@linaro.org> writes:
> 
>> On Thu, 7 May 2020 at 19:38, Alex Bennée <alex.bennee@linaro.org> wrote:
>>>
>>>
>>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>>>
>>>> The BootLinuxAarch64.test_virt_tcg is reported to take >7min to run.
>>>> Add a possibility to users to skip this particular test, by setting
>>>> the AVOCADO_SKIP_SLOW_TESTS environment variable:
>>>>
>>>>    $ AVOCADO_SKIP_SLOW_TESTS=please make check-acceptance
>>>>    ...
>>>>      (05/88) tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg: SKIP: Test takes >7min
>>>>    ...
>>>
>>> 7m = 420s - I'm seeing:
>>>
>>>    hyperfine "./tests/venv/bin/avocado run ./tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg"
>>>    Benchmark #1: ./tests/venv/bin/avocado run ./tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg
>>>      Time (mean ± σ):     162.179 s ±  3.138 s    [User: 204.726 s, System: 9.663 s]
>>>      Range (min … max):   158.651 s … 170.036 s    10 runs
>>>
>>> Is this on very slow hardware?
>>
>> Intel(R) Xeon(R) W-2145 CPU @ 3.70GHz 16-core
>> clang sanitizer build, which probably slows it down a bit.
>>
>> But even 200 seconds is an order of magnitude slower than any
>> of the other tests that check-acceptance runs. I think we
>> should be aiming for tests here to be ~30 seconds at most,
>> or the whole thing will take forever by the time we have
>> decent coverage of most machines.
> 
> I think we could say the same for a whole bunch of the tests that are
> based on full distro downloads. What is this one running under the hood
> anyway?

Download time is now counted separately, this was one big feature 
request after the last KVM forum.

The second request was to improve test timing management, like having 
different timers tracking if the test is behaving as expected. I.e. you 
might want to boot a VM and run 'ping -c 3'. The whole test shouldn't 
take more than 7min, but we want to be sure the 'ping' command doesn't 
take more than 3.x seconds. I haven't heard about a such feature ready yet.

I really hope you are using a common cache location and now download the 
artifacts each time...

> 
> 
>>
>> thanks
>> -- PMM
> 
>
Lukas Straub May 9, 2020, 1:18 p.m. UTC | #5
On Thu,  7 May 2020 18:22:35 +0200
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> The BootLinuxAarch64.test_virt_tcg is reported to take >7min to run.
> Add a possibility to users to skip this particular test, by setting
> the AVOCADO_SKIP_SLOW_TESTS environment variable:
> 
>   $ AVOCADO_SKIP_SLOW_TESTS=please make check-acceptance
>   ...
>     (05/88) tests/acceptance/boot_linux.py:BootLinuxAarch64.test_virt_tcg: SKIP: Test takes >7min
>   ...
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/acceptance/boot_linux.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py
> index 075a386300..a8df50d769 100644
> --- a/tests/acceptance/boot_linux.py
> +++ b/tests/acceptance/boot_linux.py
> @@ -15,6 +15,7 @@
>  from qemu.accel import kvm_available
>  from qemu.accel import tcg_available
>  
> +from avocado import skipIf
>  from avocado.utils import cloudinit
>  from avocado.utils import network
>  from avocado.utils import vmimage
> @@ -159,6 +160,7 @@ def add_common_args(self):
>          self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
>          self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')
>  
> +    @skipIf(os.getenv('AVOCADO_SKIP_SLOW_TESTS'), 'Test takes >7min')
>      def test_virt_tcg(self):
>          """
>          :avocado: tags=accel:tcg

Hi,
Why not simply add slow tag to the test. Like:
:avocado: tags=slow

The slow tests can then be skipped with
$ make check-acceptance AVOCADO_TAGS='-t -slow'

Regards,
Lukas Straub
Peter Maydell May 11, 2020, 9:11 a.m. UTC | #6
On Sat, 9 May 2020 at 14:18, Lukas Straub <lukasstraub2@web.de> wrote:
> Hi,
> Why not simply add slow tag to the test. Like:
> :avocado: tags=slow
>
> The slow tests can then be skipped with
> $ make check-acceptance AVOCADO_TAGS='-t -slow'

Is it possible to have the default be "do the fast stuff"
and only do the slow stuff if the user asks? That's the
way round that we do the iotests, I think.

thanks
-- PMM
Lukas Straub May 11, 2020, 4:51 p.m. UTC | #7
On Mon, 11 May 2020 10:11:20 +0100
Peter Maydell <peter.maydell@linaro.org> wrote:

> On Sat, 9 May 2020 at 14:18, Lukas Straub <lukasstraub2@web.de> wrote:
> > Hi,
> > Why not simply add slow tag to the test. Like:
> > :avocado: tags=slow
> >
> > The slow tests can then be skipped with
> > $ make check-acceptance AVOCADO_TAGS='-t -slow'  
> 
> Is it possible to have the default be "do the fast stuff"
> and only do the slow stuff if the user asks? That's the
> way round that we do the iotests, I think.

I'd set AVOCADO_TAGS to '-t -slow' by default, but now that I look at the Makefile it's not that simple:

AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGET_DIRS)))

We'd have to change the tests to skip if their target was not built. Than we can use tags for uses like this (and more like net, disk, ... tags). That would make it easier to filter the tests one wants to run: https://avocado-framework.readthedocs.io/en/78.0/guides/user/chapters/tags.html

Regards,
Lukas Straub

> thanks
> -- PMM
Philippe Mathieu-Daudé May 26, 2020, 9:14 a.m. UTC | #8
+Cleber

On 5/11/20 6:51 PM, Lukas Straub wrote:
> On Mon, 11 May 2020 10:11:20 +0100
> Peter Maydell <peter.maydell@linaro.org> wrote:
> 
>> On Sat, 9 May 2020 at 14:18, Lukas Straub <lukasstraub2@web.de> wrote:
>>> Hi,
>>> Why not simply add slow tag to the test. Like:
>>> :avocado: tags=slow
>>>
>>> The slow tests can then be skipped with
>>> $ make check-acceptance AVOCADO_TAGS='-t -slow'  
>>
>> Is it possible to have the default be "do the fast stuff"
>> and only do the slow stuff if the user asks? That's the
>> way round that we do the iotests, I think.
> 
> I'd set AVOCADO_TAGS to '-t -slow' by default, but now that I look at the Makefile it's not that simple:
> 
> AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGET_DIRS)))
> 
> We'd have to change the tests to skip if their target was not built. Than we can use tags for uses like this (and more like net, disk, ... tags). That would make it easier to filter the tests one wants to run: https://avocado-framework.readthedocs.io/en/78.0/guides/user/chapters/tags.html

Cleber what do you think of this approach?

> 
> Regards,
> Lukas Straub
> 
>> thanks
>> -- PMM
>
diff mbox series

Patch

diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py
index 075a386300..a8df50d769 100644
--- a/tests/acceptance/boot_linux.py
+++ b/tests/acceptance/boot_linux.py
@@ -15,6 +15,7 @@ 
 from qemu.accel import kvm_available
 from qemu.accel import tcg_available
 
+from avocado import skipIf
 from avocado.utils import cloudinit
 from avocado.utils import network
 from avocado.utils import vmimage
@@ -159,6 +160,7 @@  def add_common_args(self):
         self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
         self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')
 
+    @skipIf(os.getenv('AVOCADO_SKIP_SLOW_TESTS'), 'Test takes >7min')
     def test_virt_tcg(self):
         """
         :avocado: tags=accel:tcg