* [PATCH] tests/qtest: failover: fix infinite loop
@ 2022-03-29 12:42 Laurent Vivier
2022-03-29 12:47 ` Thomas Huth
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Laurent Vivier @ 2022-03-29 12:42 UTC (permalink / raw)
To: qemu-devel
Cc: Laurent Vivier, Peter Maydell, Thomas Huth,
Dr . David Alan Gilbert, Paolo Bonzini, Alex Bennée
If the migration is over before we cancel it, we are
waiting in a loop a state that never comes because the state
is already "completed".
To avoid an infinite loop, skip the test if the migration
is "completed" before we were able to cancel it.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
tests/qtest/virtio-net-failover.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index 80292eecf65f..78811f1c9216 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -1141,6 +1141,11 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
ret = migrate_status(qts);
status = qdict_get_str(ret, "status");
+ if (strcmp(status, "completed") == 0) {
+ g_test_skip("Failed to cancel the migration");
+ qobject_unref(ret);
+ goto out;
+ }
if (strcmp(status, "active") == 0) {
qobject_unref(ret);
break;
@@ -1155,8 +1160,12 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
while (true) {
ret = migrate_status(qts);
-
status = qdict_get_str(ret, "status");
+ if (strcmp(status, "completed") == 0) {
+ g_test_skip("Failed to cancel the migration");
+ qobject_unref(ret);
+ goto out;
+ }
if (strcmp(status, "cancelled") == 0) {
qobject_unref(ret);
break;
@@ -1169,6 +1178,7 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
check_one_card(qts, true, "standby0", MAC_STANDBY0);
check_one_card(qts, false, "primary0", MAC_PRIMARY0);
+out:
qos_object_destroy((QOSGraphObject *)vdev);
machine_stop(qts);
}
@@ -1251,8 +1261,7 @@ static void test_migrate_abort_wait_unplug(gconstpointer opaque)
qobject_unref(ret);
break;
}
- g_assert_cmpstr(status, !=, "failed");
- g_assert_cmpstr(status, !=, "active");
+ g_assert_cmpstr(status, ==, "cancelling");
qobject_unref(ret);
}
@@ -1324,11 +1333,11 @@ static void test_migrate_abort_active(gconstpointer opaque)
ret = migrate_status(qts);
status = qdict_get_str(ret, "status");
+ g_assert_cmpstr(status, !=, "failed");
if (strcmp(status, "wait-unplug") != 0) {
qobject_unref(ret);
break;
}
- g_assert_cmpstr(status, !=, "failed");
qobject_unref(ret);
}
@@ -1340,6 +1349,11 @@ static void test_migrate_abort_active(gconstpointer opaque)
ret = migrate_status(qts);
status = qdict_get_str(ret, "status");
+ if (strcmp(status, "completed") == 0) {
+ g_test_skip("Failed to cancel the migration");
+ qobject_unref(ret);
+ goto out;
+ }
if (strcmp(status, "cancelled") == 0) {
qobject_unref(ret);
break;
@@ -1352,6 +1366,7 @@ static void test_migrate_abort_active(gconstpointer opaque)
check_one_card(qts, true, "standby0", MAC_STANDBY0);
check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+out:
qos_object_destroy((QOSGraphObject *)vdev);
machine_stop(qts);
}
@@ -1425,6 +1440,11 @@ static void test_migrate_off_abort(gconstpointer opaque)
ret = migrate_status(qts);
status = qdict_get_str(ret, "status");
+ if (strcmp(status, "completed") == 0) {
+ g_test_skip("Failed to cancel the migration");
+ qobject_unref(ret);
+ goto out;
+ }
if (strcmp(status, "cancelled") == 0) {
qobject_unref(ret);
break;
@@ -1437,6 +1457,7 @@ static void test_migrate_off_abort(gconstpointer opaque)
check_one_card(qts, true, "standby0", MAC_STANDBY0);
check_one_card(qts, true, "primary0", MAC_PRIMARY0);
+out:
qos_object_destroy((QOSGraphObject *)vdev);
machine_stop(qts);
}
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] tests/qtest: failover: fix infinite loop
2022-03-29 12:42 [PATCH] tests/qtest: failover: fix infinite loop Laurent Vivier
@ 2022-03-29 12:47 ` Thomas Huth
2022-03-29 13:23 ` Peter Maydell
2022-03-29 18:13 ` Peter Maydell
2022-04-04 17:48 ` Dr. David Alan Gilbert
2 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2022-03-29 12:47 UTC (permalink / raw)
To: Laurent Vivier, qemu-devel
Cc: Peter Maydell, Alex Bennée, Dr . David Alan Gilbert,
Paolo Bonzini
On 29/03/2022 14.42, Laurent Vivier wrote:
> If the migration is over before we cancel it, we are
> waiting in a loop a state that never comes because the state
> is already "completed".
>
> To avoid an infinite loop, skip the test if the migration
> is "completed" before we were able to cancel it.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/qtest/virtio-net-failover.c | 29 +++++++++++++++++++++++++----
> 1 file changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
> index 80292eecf65f..78811f1c9216 100644
> --- a/tests/qtest/virtio-net-failover.c
> +++ b/tests/qtest/virtio-net-failover.c
> @@ -1141,6 +1141,11 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
> ret = migrate_status(qts);
>
> status = qdict_get_str(ret, "status");
> + if (strcmp(status, "completed") == 0) {
> + g_test_skip("Failed to cancel the migration");
> + qobject_unref(ret);
> + goto out;
> + }
> if (strcmp(status, "active") == 0) {
> qobject_unref(ret);
> break;
> @@ -1155,8 +1160,12 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
>
> while (true) {
> ret = migrate_status(qts);
> -
> status = qdict_get_str(ret, "status");
> + if (strcmp(status, "completed") == 0) {
> + g_test_skip("Failed to cancel the migration");
> + qobject_unref(ret);
> + goto out;
> + }
> if (strcmp(status, "cancelled") == 0) {
> qobject_unref(ret);
> break;
> @@ -1169,6 +1178,7 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
> check_one_card(qts, true, "standby0", MAC_STANDBY0);
> check_one_card(qts, false, "primary0", MAC_PRIMARY0);
>
> +out:
> qos_object_destroy((QOSGraphObject *)vdev);
> machine_stop(qts);
> }
> @@ -1251,8 +1261,7 @@ static void test_migrate_abort_wait_unplug(gconstpointer opaque)
> qobject_unref(ret);
> break;
> }
> - g_assert_cmpstr(status, !=, "failed");
> - g_assert_cmpstr(status, !=, "active");
> + g_assert_cmpstr(status, ==, "cancelling");
> qobject_unref(ret);
> }
>
> @@ -1324,11 +1333,11 @@ static void test_migrate_abort_active(gconstpointer opaque)
> ret = migrate_status(qts);
>
> status = qdict_get_str(ret, "status");
> + g_assert_cmpstr(status, !=, "failed");
> if (strcmp(status, "wait-unplug") != 0) {
> qobject_unref(ret);
> break;
> }
> - g_assert_cmpstr(status, !=, "failed");
> qobject_unref(ret);
> }
>
> @@ -1340,6 +1349,11 @@ static void test_migrate_abort_active(gconstpointer opaque)
> ret = migrate_status(qts);
>
> status = qdict_get_str(ret, "status");
> + if (strcmp(status, "completed") == 0) {
> + g_test_skip("Failed to cancel the migration");
> + qobject_unref(ret);
> + goto out;
> + }
> if (strcmp(status, "cancelled") == 0) {
> qobject_unref(ret);
> break;
> @@ -1352,6 +1366,7 @@ static void test_migrate_abort_active(gconstpointer opaque)
> check_one_card(qts, true, "standby0", MAC_STANDBY0);
> check_one_card(qts, true, "primary0", MAC_PRIMARY0);
>
> +out:
> qos_object_destroy((QOSGraphObject *)vdev);
> machine_stop(qts);
> }
> @@ -1425,6 +1440,11 @@ static void test_migrate_off_abort(gconstpointer opaque)
> ret = migrate_status(qts);
>
> status = qdict_get_str(ret, "status");
> + if (strcmp(status, "completed") == 0) {
> + g_test_skip("Failed to cancel the migration");
> + qobject_unref(ret);
> + goto out;
> + }
> if (strcmp(status, "cancelled") == 0) {
> qobject_unref(ret);
> break;
> @@ -1437,6 +1457,7 @@ static void test_migrate_off_abort(gconstpointer opaque)
> check_one_card(qts, true, "standby0", MAC_STANDBY0);
> check_one_card(qts, true, "primary0", MAC_PRIMARY0);
>
> +out:
> qos_object_destroy((QOSGraphObject *)vdev);
> machine_stop(qts);
> }
Acked-by: Thomas Huth <thuth@redhat.com>
Is this still urgent for 7.0, or can it wait for the 7.1 cycle?
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] tests/qtest: failover: fix infinite loop
2022-03-29 12:47 ` Thomas Huth
@ 2022-03-29 13:23 ` Peter Maydell
2022-03-29 13:25 ` Thomas Huth
0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2022-03-29 13:23 UTC (permalink / raw)
To: Thomas Huth
Cc: Laurent Vivier, Paolo Bonzini, Alex Bennée, qemu-devel,
Dr . David Alan Gilbert
On Tue, 29 Mar 2022 at 13:47, Thomas Huth <thuth@redhat.com> wrote:
>
> On 29/03/2022 14.42, Laurent Vivier wrote:
> > If the migration is over before we cancel it, we are
> > waiting in a loop a state that never comes because the state
> > is already "completed".
> >
> > To avoid an infinite loop, skip the test if the migration
> > is "completed" before we were able to cancel it.
> Is this still urgent for 7.0, or can it wait for the 7.1 cycle?
It's a test case change that fixes at least one hang I've seen
in "make check". I prefer those to go in, at least before rc3,
because the CI loop being unreliable makes the whole release
process slower and more annoying.
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] tests/qtest: failover: fix infinite loop
2022-03-29 13:23 ` Peter Maydell
@ 2022-03-29 13:25 ` Thomas Huth
2022-03-29 13:27 ` Peter Maydell
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2022-03-29 13:25 UTC (permalink / raw)
To: Peter Maydell
Cc: Laurent Vivier, Paolo Bonzini, Alex Bennée, qemu-devel,
Dr . David Alan Gilbert
On 29/03/2022 15.23, Peter Maydell wrote:
> On Tue, 29 Mar 2022 at 13:47, Thomas Huth <thuth@redhat.com> wrote:
>>
>> On 29/03/2022 14.42, Laurent Vivier wrote:
>>> If the migration is over before we cancel it, we are
>>> waiting in a loop a state that never comes because the state
>>> is already "completed".
>>>
>>> To avoid an infinite loop, skip the test if the migration
>>> is "completed" before we were able to cancel it.
>
>> Is this still urgent for 7.0, or can it wait for the 7.1 cycle?
>
> It's a test case change that fixes at least one hang I've seen
> in "make check". I prefer those to go in, at least before rc3,
> because the CI loop being unreliable makes the whole release
> process slower and more annoying.
Ok. Do you want to pick it directly, or shall I create a pull request for
this? (I don't have much else queued right now, that's why I ask)
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] tests/qtest: failover: fix infinite loop
2022-03-29 13:25 ` Thomas Huth
@ 2022-03-29 13:27 ` Peter Maydell
2022-03-29 13:28 ` Thomas Huth
0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2022-03-29 13:27 UTC (permalink / raw)
To: Thomas Huth
Cc: Laurent Vivier, Paolo Bonzini, Alex Bennée, qemu-devel,
Dr . David Alan Gilbert
On Tue, 29 Mar 2022 at 14:25, Thomas Huth <thuth@redhat.com> wrote:
>
> On 29/03/2022 15.23, Peter Maydell wrote:
> > On Tue, 29 Mar 2022 at 13:47, Thomas Huth <thuth@redhat.com> wrote:
> >>
> >> On 29/03/2022 14.42, Laurent Vivier wrote:
> >>> If the migration is over before we cancel it, we are
> >>> waiting in a loop a state that never comes because the state
> >>> is already "completed".
> >>>
> >>> To avoid an infinite loop, skip the test if the migration
> >>> is "completed" before we were able to cancel it.
> >
> >> Is this still urgent for 7.0, or can it wait for the 7.1 cycle?
> >
> > It's a test case change that fixes at least one hang I've seen
> > in "make check". I prefer those to go in, at least before rc3,
> > because the CI loop being unreliable makes the whole release
> > process slower and more annoying.
>
> Ok. Do you want to pick it directly, or shall I create a pull request for
> this? (I don't have much else queued right now, that's why I ask)
I can apply it directly if you don't have anything else you're
sending anyway.
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] tests/qtest: failover: fix infinite loop
2022-03-29 13:27 ` Peter Maydell
@ 2022-03-29 13:28 ` Thomas Huth
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Huth @ 2022-03-29 13:28 UTC (permalink / raw)
To: Peter Maydell
Cc: Laurent Vivier, Paolo Bonzini, Alex Bennée, qemu-devel,
Dr . David Alan Gilbert
On 29/03/2022 15.27, Peter Maydell wrote:
> On Tue, 29 Mar 2022 at 14:25, Thomas Huth <thuth@redhat.com> wrote:
>>
>> On 29/03/2022 15.23, Peter Maydell wrote:
>>> On Tue, 29 Mar 2022 at 13:47, Thomas Huth <thuth@redhat.com> wrote:
>>>>
>>>> On 29/03/2022 14.42, Laurent Vivier wrote:
>>>>> If the migration is over before we cancel it, we are
>>>>> waiting in a loop a state that never comes because the state
>>>>> is already "completed".
>>>>>
>>>>> To avoid an infinite loop, skip the test if the migration
>>>>> is "completed" before we were able to cancel it.
>>>
>>>> Is this still urgent for 7.0, or can it wait for the 7.1 cycle?
>>>
>>> It's a test case change that fixes at least one hang I've seen
>>> in "make check". I prefer those to go in, at least before rc3,
>>> because the CI loop being unreliable makes the whole release
>>> process slower and more annoying.
>>
>> Ok. Do you want to pick it directly, or shall I create a pull request for
>> this? (I don't have much else queued right now, that's why I ask)
>
> I can apply it directly if you don't have anything else you're
> sending anyway.
Ok, then please apply directly! Thanks!
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] tests/qtest: failover: fix infinite loop
2022-03-29 12:42 [PATCH] tests/qtest: failover: fix infinite loop Laurent Vivier
2022-03-29 12:47 ` Thomas Huth
@ 2022-03-29 18:13 ` Peter Maydell
2022-04-04 17:48 ` Dr. David Alan Gilbert
2 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2022-03-29 18:13 UTC (permalink / raw)
To: Laurent Vivier
Cc: Paolo Bonzini, Thomas Huth, Alex Bennée, qemu-devel,
Dr . David Alan Gilbert
On Tue, 29 Mar 2022 at 13:43, Laurent Vivier <lvivier@redhat.com> wrote:
>
> If the migration is over before we cancel it, we are
> waiting in a loop a state that never comes because the state
> is already "completed".
>
> To avoid an infinite loop, skip the test if the migration
> is "completed" before we were able to cancel it.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/qtest/virtio-net-failover.c | 29 +++++++++++++++++++++++++----
> 1 file changed, 25 insertions(+), 4 deletions(-)
Applied to master, thanks.
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] tests/qtest: failover: fix infinite loop
2022-03-29 12:42 [PATCH] tests/qtest: failover: fix infinite loop Laurent Vivier
2022-03-29 12:47 ` Thomas Huth
2022-03-29 18:13 ` Peter Maydell
@ 2022-04-04 17:48 ` Dr. David Alan Gilbert
2 siblings, 0 replies; 8+ messages in thread
From: Dr. David Alan Gilbert @ 2022-04-04 17:48 UTC (permalink / raw)
To: Laurent Vivier
Cc: Peter Maydell, Thomas Huth, Alex Bennée, qemu-devel,
Paolo Bonzini
* Laurent Vivier (lvivier@redhat.com) wrote:
> If the migration is over before we cancel it, we are
> waiting in a loop a state that never comes because the state
> is already "completed".
>
> To avoid an infinite loop, skip the test if the migration
> is "completed" before we were able to cancel it.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
If you're finding it's skipping to often, you might try setting the
migration bandwidth really low right at the start (a few bytes/second)
to ensure it doesn't complete under your feet.
Dave
> ---
> tests/qtest/virtio-net-failover.c | 29 +++++++++++++++++++++++++----
> 1 file changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
> index 80292eecf65f..78811f1c9216 100644
> --- a/tests/qtest/virtio-net-failover.c
> +++ b/tests/qtest/virtio-net-failover.c
> @@ -1141,6 +1141,11 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
> ret = migrate_status(qts);
>
> status = qdict_get_str(ret, "status");
> + if (strcmp(status, "completed") == 0) {
> + g_test_skip("Failed to cancel the migration");
> + qobject_unref(ret);
> + goto out;
> + }
> if (strcmp(status, "active") == 0) {
> qobject_unref(ret);
> break;
> @@ -1155,8 +1160,12 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
>
> while (true) {
> ret = migrate_status(qts);
> -
> status = qdict_get_str(ret, "status");
> + if (strcmp(status, "completed") == 0) {
> + g_test_skip("Failed to cancel the migration");
> + qobject_unref(ret);
> + goto out;
> + }
> if (strcmp(status, "cancelled") == 0) {
> qobject_unref(ret);
> break;
> @@ -1169,6 +1178,7 @@ static void test_migrate_guest_off_abort(gconstpointer opaque)
> check_one_card(qts, true, "standby0", MAC_STANDBY0);
> check_one_card(qts, false, "primary0", MAC_PRIMARY0);
>
> +out:
> qos_object_destroy((QOSGraphObject *)vdev);
> machine_stop(qts);
> }
> @@ -1251,8 +1261,7 @@ static void test_migrate_abort_wait_unplug(gconstpointer opaque)
> qobject_unref(ret);
> break;
> }
> - g_assert_cmpstr(status, !=, "failed");
> - g_assert_cmpstr(status, !=, "active");
> + g_assert_cmpstr(status, ==, "cancelling");
> qobject_unref(ret);
> }
>
> @@ -1324,11 +1333,11 @@ static void test_migrate_abort_active(gconstpointer opaque)
> ret = migrate_status(qts);
>
> status = qdict_get_str(ret, "status");
> + g_assert_cmpstr(status, !=, "failed");
> if (strcmp(status, "wait-unplug") != 0) {
> qobject_unref(ret);
> break;
> }
> - g_assert_cmpstr(status, !=, "failed");
> qobject_unref(ret);
> }
>
> @@ -1340,6 +1349,11 @@ static void test_migrate_abort_active(gconstpointer opaque)
> ret = migrate_status(qts);
>
> status = qdict_get_str(ret, "status");
> + if (strcmp(status, "completed") == 0) {
> + g_test_skip("Failed to cancel the migration");
> + qobject_unref(ret);
> + goto out;
> + }
> if (strcmp(status, "cancelled") == 0) {
> qobject_unref(ret);
> break;
> @@ -1352,6 +1366,7 @@ static void test_migrate_abort_active(gconstpointer opaque)
> check_one_card(qts, true, "standby0", MAC_STANDBY0);
> check_one_card(qts, true, "primary0", MAC_PRIMARY0);
>
> +out:
> qos_object_destroy((QOSGraphObject *)vdev);
> machine_stop(qts);
> }
> @@ -1425,6 +1440,11 @@ static void test_migrate_off_abort(gconstpointer opaque)
> ret = migrate_status(qts);
>
> status = qdict_get_str(ret, "status");
> + if (strcmp(status, "completed") == 0) {
> + g_test_skip("Failed to cancel the migration");
> + qobject_unref(ret);
> + goto out;
> + }
> if (strcmp(status, "cancelled") == 0) {
> qobject_unref(ret);
> break;
> @@ -1437,6 +1457,7 @@ static void test_migrate_off_abort(gconstpointer opaque)
> check_one_card(qts, true, "standby0", MAC_STANDBY0);
> check_one_card(qts, true, "primary0", MAC_PRIMARY0);
>
> +out:
> qos_object_destroy((QOSGraphObject *)vdev);
> machine_stop(qts);
> }
> --
> 2.35.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-04-04 17:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29 12:42 [PATCH] tests/qtest: failover: fix infinite loop Laurent Vivier
2022-03-29 12:47 ` Thomas Huth
2022-03-29 13:23 ` Peter Maydell
2022-03-29 13:25 ` Thomas Huth
2022-03-29 13:27 ` Peter Maydell
2022-03-29 13:28 ` Thomas Huth
2022-03-29 18:13 ` Peter Maydell
2022-04-04 17:48 ` Dr. David Alan Gilbert
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).