qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Phil Mathieu-Daudé" <philmd@linaro.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>, "John Snow" <jsnow@redhat.com>
Subject: Re: avocado test: log shows initial chunk of terminal output is missing
Date: Mon, 17 Jul 2023 16:54:04 +0100	[thread overview]
Message-ID: <ZLVkHOGbbqFnN66G@redhat.com> (raw)
In-Reply-To: <CAFEAcA-fos6Agg09mtZJDdcStpCqdnLpyW4=MQnKRkZA_Tt9Zw@mail.gmail.com>

On Mon, Jul 17, 2023 at 04:42:30PM +0100, Peter Maydell wrote:
> I'm looking at an avocado test that's failing intermittently
> on s390 host:
> machine_aarch64_sbsaref.py:Aarch64SbsarefMachine.test_sbsaref_edk2_firmware
> 
> This test looks for various things on the terminal output,
> and it's failing because it hasn't seen the first thing it looks
> for. The avocado log seems to show that the guest has booted
> past that point and has produced a later chunk of the output,
> and avocado appears to have simply lost the earlier output that
> the test case is trying to match on.

Having had a quick look at the test code the test is calling
wait_for_console_pattern() to match console output. This
method calls _console_interaction(), which accesses the property
vm.console_socket. The code in this method does a lazy create
of the socket:

    @property
    def console_socket(self) -> socket.socket:
        """
        Returns a socket connected to the console
        """
        if self._console_socket is None:
            self._console_socket = console_socket.ConsoleSocket(
                self._console_address,
                file=self._console_log_path,
                drain=self._drain_console)
        return self._console_socket

We're configuring the VM with a UNIX socket for the console. Even
if we moved the console_socket.ConsoleSocket() call directly into
the 'launch()' method this would still be inherantly racy.

The solution is the same as we prviously did for the QMP socket.
the QEMUMachine class needs to pre-create the UNIX socket and
pass the pre-opened FD into QEMU, which will guarantee no race
condition.

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 :|



      reply	other threads:[~2023-07-17 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 15:42 avocado test: log shows initial chunk of terminal output is missing Peter Maydell
2023-07-17 15:54 ` Daniel P. Berrangé [this message]

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=ZLVkHOGbbqFnN66G@redhat.com \
    --to=berrange@redhat.com \
    --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).