All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iotests: Revert emulator selection to old behaviour
@ 2021-02-02 14:28 Kevin Wolf
  2021-02-02 14:35 ` Philippe Mathieu-Daudé
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Kevin Wolf @ 2021-02-02 14:28 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, vsementsov, berrange, qemu-devel

If the qemu-system-{arch} binary for the host architecture can't be
found, the old 'check' implementation selected the alphabetically first
system emulator binary that it could find. The new Python implementation
just uses the first result of glob.iglob(), which has an undefined
order.

This is a problem that breaks CI because the iotests aren't actually
prepared to run on any emulator. They should be, so this is really a bug
in the failing test cases that should be fixed there, but as a quick
fix, let's revert to the old behaviour to let CI runs succeed again.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/testenv.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
index b31275f518..1fbec854c1 100644
--- a/tests/qemu-iotests/testenv.py
+++ b/tests/qemu-iotests/testenv.py
@@ -135,7 +135,7 @@ class TestEnv(ContextManager['TestEnv']):
         if not os.path.exists(self.qemu_prog):
             pattern = root('qemu-system-*')
             try:
-                progs = glob.iglob(pattern)
+                progs = sorted(glob.iglob(pattern))
                 self.qemu_prog = next(p for p in progs if isxfile(p))
             except StopIteration:
                 sys.exit("Not found any Qemu executable binary by pattern "
-- 
2.29.2



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

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:28 [PATCH] iotests: Revert emulator selection to old behaviour Kevin Wolf
@ 2021-02-02 14:35 ` Philippe Mathieu-Daudé
  2021-02-02 14:41 ` Daniel P. Berrangé
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-02 14:35 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: peter.maydell, vsementsov, berrange, qemu-devel

On 2/2/21 3:28 PM, Kevin Wolf wrote:
> If the qemu-system-{arch} binary for the host architecture can't be
> found, the old 'check' implementation selected the alphabetically first
> system emulator binary that it could find. The new Python implementation
> just uses the first result of glob.iglob(), which has an undefined
> order.
> 
> This is a problem that breaks CI because the iotests aren't actually
> prepared to run on any emulator. They should be, so this is really a bug
> in the failing test cases that should be fixed there, but as a quick
> fix, let's revert to the old behaviour to let CI runs succeed again.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/testenv.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:28 [PATCH] iotests: Revert emulator selection to old behaviour Kevin Wolf
  2021-02-02 14:35 ` Philippe Mathieu-Daudé
@ 2021-02-02 14:41 ` Daniel P. Berrangé
  2021-02-02 14:51   ` Kevin Wolf
  2021-02-02 14:46 ` Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Daniel P. Berrangé @ 2021-02-02 14:41 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: peter.maydell, vsementsov, qemu-devel, qemu-block

On Tue, Feb 02, 2021 at 03:28:02PM +0100, Kevin Wolf wrote:
> If the qemu-system-{arch} binary for the host architecture can't be
> found, the old 'check' implementation selected the alphabetically first
> system emulator binary that it could find. The new Python implementation
> just uses the first result of glob.iglob(), which has an undefined
> order.
> 
> This is a problem that breaks CI because the iotests aren't actually
> prepared to run on any emulator. They should be, so this is really a bug
> in the failing test cases that should be fixed there, but as a quick
> fix, let's revert to the old behaviour to let CI runs succeed again.

Deterministic CI is critically important.

> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/testenv.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


> 
> diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
> index b31275f518..1fbec854c1 100644
> --- a/tests/qemu-iotests/testenv.py
> +++ b/tests/qemu-iotests/testenv.py
> @@ -135,7 +135,7 @@ class TestEnv(ContextManager['TestEnv']):
>          if not os.path.exists(self.qemu_prog):
>              pattern = root('qemu-system-*')
>              try:
> -                progs = glob.iglob(pattern)
> +                progs = sorted(glob.iglob(pattern))
>                  self.qemu_prog = next(p for p in progs if isxfile(p))
>              except StopIteration:
>                  sys.exit("Not found any Qemu executable binary by pattern "
> -- 
> 2.29.2
> 

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] 10+ messages in thread

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:28 [PATCH] iotests: Revert emulator selection to old behaviour Kevin Wolf
  2021-02-02 14:35 ` Philippe Mathieu-Daudé
  2021-02-02 14:41 ` Daniel P. Berrangé
@ 2021-02-02 14:46 ` Philippe Mathieu-Daudé
  2021-02-02 14:48   ` Philippe Mathieu-Daudé
  2021-02-02 14:56   ` Daniel P. Berrangé
  2021-02-02 14:54 ` Eric Blake
  2021-02-02 15:48 ` Vladimir Sementsov-Ogievskiy
  4 siblings, 2 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-02 14:46 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: peter.maydell, vsementsov, berrange, qemu-devel

On 2/2/21 3:28 PM, Kevin Wolf wrote:
> If the qemu-system-{arch} binary for the host architecture can't be
> found, the old 'check' implementation selected the alphabetically first
> system emulator binary that it could find. The new Python implementation
> just uses the first result of glob.iglob(), which has an undefined
> order.
> 
> This is a problem that breaks CI because the iotests aren't actually
> prepared to run on any emulator. They should be, so this is really a bug
> in the failing test cases that should be fixed there, but as a quick
> fix, let's revert to the old behaviour to let CI runs succeed again.

FWIW this is the same problem I had 1 year ago and tried to
fix it by sending QMP 'query-version' (introduced in v0.14):
https://www.mail-archive.com/qemu-devel@nongnu.org/msg675075.html

> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/testenv.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
> index b31275f518..1fbec854c1 100644
> --- a/tests/qemu-iotests/testenv.py
> +++ b/tests/qemu-iotests/testenv.py
> @@ -135,7 +135,7 @@ class TestEnv(ContextManager['TestEnv']):
>          if not os.path.exists(self.qemu_prog):
>              pattern = root('qemu-system-*')
>              try:
> -                progs = glob.iglob(pattern)
> +                progs = sorted(glob.iglob(pattern))
>                  self.qemu_prog = next(p for p in progs if isxfile(p))
>              except StopIteration:
>                  sys.exit("Not found any Qemu executable binary by pattern "
> 



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

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:46 ` Philippe Mathieu-Daudé
@ 2021-02-02 14:48   ` Philippe Mathieu-Daudé
  2021-02-02 14:56   ` Daniel P. Berrangé
  1 sibling, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-02 14:48 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block, Wainer dos Santos Moschetta, Willian Rampazzo
  Cc: peter.maydell, vsementsov, berrange, qemu-devel, Eduardo Habkost

Forgot to Cc Wainer & Willian in case they are interested in
providing a better long term fix.

On 2/2/21 3:46 PM, Philippe Mathieu-Daudé wrote:
> On 2/2/21 3:28 PM, Kevin Wolf wrote:
>> If the qemu-system-{arch} binary for the host architecture can't be
>> found, the old 'check' implementation selected the alphabetically first
>> system emulator binary that it could find. The new Python implementation
>> just uses the first result of glob.iglob(), which has an undefined
>> order.
>>
>> This is a problem that breaks CI because the iotests aren't actually
>> prepared to run on any emulator. They should be, so this is really a bug
>> in the failing test cases that should be fixed there, but as a quick
>> fix, let's revert to the old behaviour to let CI runs succeed again.
> 
> FWIW this is the same problem I had 1 year ago and tried to
> fix it by sending QMP 'query-version' (introduced in v0.14):
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg675075.html



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

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:41 ` Daniel P. Berrangé
@ 2021-02-02 14:51   ` Kevin Wolf
  0 siblings, 0 replies; 10+ messages in thread
From: Kevin Wolf @ 2021-02-02 14:51 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: peter.maydell, vsementsov, qemu-devel, qemu-block

Am 02.02.2021 um 15:41 hat Daniel P. Berrangé geschrieben:
> On Tue, Feb 02, 2021 at 03:28:02PM +0100, Kevin Wolf wrote:
> > If the qemu-system-{arch} binary for the host architecture can't be
> > found, the old 'check' implementation selected the alphabetically first
> > system emulator binary that it could find. The new Python implementation
> > just uses the first result of glob.iglob(), which has an undefined
> > order.
> > 
> > This is a problem that breaks CI because the iotests aren't actually
> > prepared to run on any emulator. They should be, so this is really a bug
> > in the failing test cases that should be fixed there, but as a quick
> > fix, let's revert to the old behaviour to let CI runs succeed again.
> 
> Deterministic CI is critically important.

True. I didn't mean to imply that we don't want deterministic behaviour,
but just that this hides some bugs in the test cases that we'll want to
have fixed eventually, too.

Maybe we should rely on automatic picking less and specify different
emulators explicitly in different CI jobs so that we don't only test the
same binary over and over again and others not at all.

Kevin



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

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:28 [PATCH] iotests: Revert emulator selection to old behaviour Kevin Wolf
                   ` (2 preceding siblings ...)
  2021-02-02 14:46 ` Philippe Mathieu-Daudé
@ 2021-02-02 14:54 ` Eric Blake
  2021-02-02 15:48 ` Vladimir Sementsov-Ogievskiy
  4 siblings, 0 replies; 10+ messages in thread
From: Eric Blake @ 2021-02-02 14:54 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: peter.maydell, vsementsov, berrange, qemu-devel

On 2/2/21 8:28 AM, Kevin Wolf wrote:
> If the qemu-system-{arch} binary for the host architecture can't be
> found, the old 'check' implementation selected the alphabetically first
> system emulator binary that it could find. The new Python implementation
> just uses the first result of glob.iglob(), which has an undefined
> order.
> 
> This is a problem that breaks CI because the iotests aren't actually
> prepared to run on any emulator. They should be, so this is really a bug
> in the failing test cases that should be fixed there, but as a quick
> fix, let's revert to the old behaviour to let CI runs succeed again.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/testenv.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

As fixing the tests is indeed more work than sorting the glob results,
this one-liner is worth checking.

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
> index b31275f518..1fbec854c1 100644
> --- a/tests/qemu-iotests/testenv.py
> +++ b/tests/qemu-iotests/testenv.py
> @@ -135,7 +135,7 @@ class TestEnv(ContextManager['TestEnv']):
>          if not os.path.exists(self.qemu_prog):
>              pattern = root('qemu-system-*')
>              try:
> -                progs = glob.iglob(pattern)
> +                progs = sorted(glob.iglob(pattern))
>                  self.qemu_prog = next(p for p in progs if isxfile(p))
>              except StopIteration:
>                  sys.exit("Not found any Qemu executable binary by pattern "
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



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

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:46 ` Philippe Mathieu-Daudé
  2021-02-02 14:48   ` Philippe Mathieu-Daudé
@ 2021-02-02 14:56   ` Daniel P. Berrangé
  2021-02-02 15:40     ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 10+ messages in thread
From: Daniel P. Berrangé @ 2021-02-02 14:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Kevin Wolf, peter.maydell, vsementsov, qemu-devel, qemu-block

On Tue, Feb 02, 2021 at 03:46:11PM +0100, Philippe Mathieu-Daudé wrote:
> On 2/2/21 3:28 PM, Kevin Wolf wrote:
> > If the qemu-system-{arch} binary for the host architecture can't be
> > found, the old 'check' implementation selected the alphabetically first
> > system emulator binary that it could find. The new Python implementation
> > just uses the first result of glob.iglob(), which has an undefined
> > order.
> > 
> > This is a problem that breaks CI because the iotests aren't actually
> > prepared to run on any emulator. They should be, so this is really a bug
> > in the failing test cases that should be fixed there, but as a quick
> > fix, let's revert to the old behaviour to let CI runs succeed again.
> 
> FWIW this is the same problem I had 1 year ago and tried to
> fix it by sending QMP 'query-version' (introduced in v0.14):
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg675075.html

In the current failures the issue isn't the version number. Rather some
of the tests (mistakenly) assume the emulator supports PCI, and we're
randomly sometimes picking emulator targets that lack PCI.


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] 10+ messages in thread

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:56   ` Daniel P. Berrangé
@ 2021-02-02 15:40     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-02 15:40 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Kevin Wolf, peter.maydell, vsementsov, qemu-devel, qemu-block

On 2/2/21 3:56 PM, Daniel P. Berrangé wrote:
> On Tue, Feb 02, 2021 at 03:46:11PM +0100, Philippe Mathieu-Daudé wrote:
>> On 2/2/21 3:28 PM, Kevin Wolf wrote:
>>> If the qemu-system-{arch} binary for the host architecture can't be
>>> found, the old 'check' implementation selected the alphabetically first
>>> system emulator binary that it could find. The new Python implementation
>>> just uses the first result of glob.iglob(), which has an undefined
>>> order.
>>>
>>> This is a problem that breaks CI because the iotests aren't actually
>>> prepared to run on any emulator. They should be, so this is really a bug
>>> in the failing test cases that should be fixed there, but as a quick
>>> fix, let's revert to the old behaviour to let CI runs succeed again.
>>
>> FWIW this is the same problem I had 1 year ago and tried to
>> fix it by sending QMP 'query-version' (introduced in v0.14):
>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg675075.html
> 
> In the current failures the issue isn't the version number. Rather some
> of the tests (mistakenly) assume the emulator supports PCI, and we're
> randomly sometimes picking emulator targets that lack PCI.

Then this patch from the same series:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg675088.html

It queries TYPE_DEVICE, but we can query TYPE_PCI_DEVICE too,
which should be selected if a machine have a TYPE_PCI_HOST_BRIDGE
providing a TYPE_PCI_BUS.

Anyway the idea is to query the binary with QMP to see if it makes
sens to run the test with it.

Regards,

Phil.



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

* Re: [PATCH] iotests: Revert emulator selection to old behaviour
  2021-02-02 14:28 [PATCH] iotests: Revert emulator selection to old behaviour Kevin Wolf
                   ` (3 preceding siblings ...)
  2021-02-02 14:54 ` Eric Blake
@ 2021-02-02 15:48 ` Vladimir Sementsov-Ogievskiy
  4 siblings, 0 replies; 10+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-02-02 15:48 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: peter.maydell, berrange, qemu-devel

02.02.2021 17:28, Kevin Wolf wrote:
> If the qemu-system-{arch} binary for the host architecture can't be
> found, the old 'check' implementation selected the alphabetically first
> system emulator binary that it could find. The new Python implementation
> just uses the first result of glob.iglob(), which has an undefined
> order.
> 
> This is a problem that breaks CI because the iotests aren't actually
> prepared to run on any emulator. They should be, so this is really a bug
> in the failing test cases that should be fixed there, but as a quick
> fix, let's revert to the old behaviour to let CI runs succeed again.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>   tests/qemu-iotests/testenv.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
> index b31275f518..1fbec854c1 100644
> --- a/tests/qemu-iotests/testenv.py
> +++ b/tests/qemu-iotests/testenv.py
> @@ -135,7 +135,7 @@ class TestEnv(ContextManager['TestEnv']):
>           if not os.path.exists(self.qemu_prog):
>               pattern = root('qemu-system-*')
>               try:
> -                progs = glob.iglob(pattern)
> +                progs = sorted(glob.iglob(pattern))
>                   self.qemu_prog = next(p for p in progs if isxfile(p))
>               except StopIteration:
>                   sys.exit("Not found any Qemu executable binary by pattern "
> 

Great that you find the problem! Anyway sorted is better than random. Probably we should print some warning when we have to chose from several binaries.. But nobody will read it anyway.

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

-- 
Best regards,
Vladimir


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

end of thread, other threads:[~2021-02-02 16:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 14:28 [PATCH] iotests: Revert emulator selection to old behaviour Kevin Wolf
2021-02-02 14:35 ` Philippe Mathieu-Daudé
2021-02-02 14:41 ` Daniel P. Berrangé
2021-02-02 14:51   ` Kevin Wolf
2021-02-02 14:46 ` Philippe Mathieu-Daudé
2021-02-02 14:48   ` Philippe Mathieu-Daudé
2021-02-02 14:56   ` Daniel P. Berrangé
2021-02-02 15:40     ` Philippe Mathieu-Daudé
2021-02-02 14:54 ` Eric Blake
2021-02-02 15:48 ` Vladimir Sementsov-Ogievskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.