qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: "Juan Quintela" <quintela@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Leonardo Bras" <leobras@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH] qtest/migration: Add a test for the analyze-migration script
Date: Thu, 28 Sep 2023 10:32:56 -0300	[thread overview]
Message-ID: <8734yyo22f.fsf@suse.de> (raw)
In-Reply-To: <62c405c9-27f2-a77a-1f94-8d03cf65fff6@redhat.com>

Thomas Huth <thuth@redhat.com> writes:

> On 27/09/2023 23.47, Fabiano Rosas wrote:
>> Add a smoke test that migrates to a file and gives it to the
>> script. It should catch the most annoying errors such as changes in
>> the ram flags.
>> 
>> After code has been merged it becomes way harder to figure out what is
>> causing the script to fail, the person making the change is the most
>> likely to know right away what the problem is.
>> 
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>> I know this adds a python dependency to qtests and I'm not sure how
>> much we care about this script, but on the other hand it would be nice
>> to catch these errors early on.
>> 
>> This would also help with future work that touches the migration
>> stream (moving multifd out of ram.c and fixed-ram).
>> 
>> Let me know what you think.
>
> Without looking at this too closely, my first thought was: This sounds 
> rather like a good candidate for an avocado test instead. It's using Python, 
> so tests/avocado/ sounds like a better fit. Have you considered adding it as 
> an avocado test already?
>

I intended to keep all migration tests at the same place. And well, to
be honest, I have given up on avocado. Too unmaintained, incrutable
logging and last time I tried to use it locally, it was leaving stale
processes behind upon failure.

Of course, if that's the preferred place to put python tests I could do
it, but I don't find it too compelling.

>  >+#define ANALYZE_SCRIPT "tests/qtest/analyze-migration.py"
>
> Why can't you use scripts/analyze-migration.py directly?
>

I'm not entirely sure that's the case with QEMU, but generally build
directories can move/not be directly under the source tree. The test
wouldn't know from where to fetch the script.

>  >+    file = g_strdup_printf("%s/migfile", tmpfs);
>
> Please, no static file names for temporary files - tests might be running in 
> parallel, and then you get race conditions! Use something like 
> g_file_open_tmp() instead to create a file with a random name.
>

Ok, I can do that. However, if you look for "tmpfs" in migration-test.c
you'll see that's done all over the place. I'm thinking individual tests
under glib are never run in parallel. At least for the migration suite.


  reply	other threads:[~2023-09-28 13:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27 21:47 [PATCH] qtest/migration: Add a test for the analyze-migration script Fabiano Rosas
2023-09-27 22:06 ` Fabiano Rosas
2023-09-28  5:07 ` Thomas Huth
2023-09-28 13:32   ` Fabiano Rosas [this message]
2023-09-28 13:40     ` Thomas Huth
2023-09-28 13:47       ` Fabiano Rosas
2023-10-11 14:40       ` Juan Quintela
2023-10-04 20:40 ` Peter Xu
2023-10-05 21:30   ` Fabiano Rosas

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=8734yyo22f.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=leobras@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=thuth@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).