qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: John Snow <jsnow@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>
Subject: Re: has anybody looked at the long-standing intermittent raspi2 avocado test failure?
Date: Thu, 20 Oct 2022 09:52:42 +0200	[thread overview]
Message-ID: <12579dec-e80e-3489-79da-9bc93b68472a@redhat.com> (raw)
In-Reply-To: <CAFn=p-aoe1QQMXkgdu_yKxb4jCTahsM1K-Fo+vtXOwG=8=_=Lw@mail.gmail.com>

On 19/10/2022 22.38, John Snow wrote:
> On Tue, Oct 18, 2022 at 6:23 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> If you run this single avocado test:
>>
>> while ./build/x86/tests/venv/bin/avocado run
>> build/x86/tests/avocado/boot_linux_console.py:BootLinuxConsole.test_arm_raspi2_initrd
>> ; do true; done
>>
>> then on my machine it will fail within 4 or 5 iterations. Has anybody
>> looked into this? Looking at a log from a failed test
>> https://people.linaro.org/~peter.maydell/raspi-avocado-fail.log
>> what seems to happen is that the test sends the "halt" command to
>> the guest. The DEBUG log reports a transition from RUNNING to
>> DISCONNECTING and the QMP connection disconnects, so presumably
>> the guest really did exit -- or is that something the test framework
>> is doing from its end?
[...]
> "Thanks for the analysis, but, like, what are you going to do to fix
> any of this?"
> 
> Long term, an asyncio version of machine.py will help alleviate these
> kinds of race conditions when dealing with multiple sockets from
> Python as our testing requirements become more complex.
> 
> Short term, I'm not sure...

As a short term fix, what about simply changing the test
like this:

diff a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -489,7 +489,7 @@ def test_arm_raspi2_initrd(self):
                                                  'BCM2835')
          exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
                                                  '/soc/cprman@7e101000')
-        exec_command(self, 'halt')
+        exec_command_and_wait_for_pattern(self, 'halt', 'System halted')
          # Wait for VM to shut down gracefully
          self.vm.wait()
  
By waiting for another console pattern that the guest sends
out after "halt", you can make sure that the connection is
not closed too early.

  Thomas



  reply	other threads:[~2022-10-20  7:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 10:23 has anybody looked at the long-standing intermittent raspi2 avocado test failure? Peter Maydell
2022-10-19 20:38 ` John Snow
2022-10-20  7:52   ` Thomas Huth [this message]
2022-10-20 10:16     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12579dec-e80e-3489-79da-9bc93b68472a@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=bleal@redhat.com \
    --cc=crosa@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).