From nobody Sun Feb 8 16:06:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656413842450600.0048572543699; Tue, 28 Jun 2022 03:57:22 -0700 (PDT) Received: from localhost ([::1]:59364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o68uH-0003KK-Eu for importer@patchew.org; Tue, 28 Jun 2022 06:57:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rk-0000DD-LP for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:39138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rj-0006TT-6n for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:44 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-131-6vhywzBpPhS3FPBxfLIJkw-1; Tue, 28 Jun 2022 06:54:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EC1D91C01B38; Tue, 28 Jun 2022 10:54:38 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6339D112131B; Tue, 28 Jun 2022 10:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656413682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WP0KrJnO47HaUcIR8S1wU3tfrrwzaaOzYfCUepH0nWE=; b=bzx1mRuvrgWlkvstNe2iVsEqg2d9bBkXS5B6ZFuDiBxuS8PASNKwHay083tklnqLFJ9YvK 48qwmW7u/fdo/bSL8ygo1vBPMwQU/C/jv53nQ1NTiv6Ls25psE7eHwYofNBsngNsg5wyyP /NczX69Z/pfMx/ZRnwhaXIdcr7SGjbg= X-MC-Unique: 6vhywzBpPhS3FPBxfLIJkw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Laurent Vivier , Juan Quintela , Thomas Huth , Cornelia Huck , qemu-s390x@nongnu.org, "Dr. David Alan Gilbert" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 1/5] tests: wait max 120 seconds for migration test status changes Date: Tue, 28 Jun 2022 11:54:30 +0100 Message-Id: <20220628105434.295905-2-berrange@redhat.com> In-Reply-To: <20220628105434.295905-1-berrange@redhat.com> References: <20220628105434.295905-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656413844165100001 Currently the wait_for_migration_fail and wait_for_migration_complete functions will spin in an infinite loop checking query-migrate status to detect a specific change/goal. This is fine when everything goes to plan, but when the unusual happens, these will hang the test suite forever. Any normally executing migration test case normally takes < 1 second for a state change, with exception of the autoconverge test which takes about 5 seconds. Taking into account possibility of people running tests inside TCG, allowing a factor of x20 slowdown gives a reasonable worst case of 120 seconds. Anything taking longer than this is a strong sign that the test has hung, or the test should be rewritten to be faster. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth Tested-by: Thomas Huth --- tests/qtest/migration-helpers.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helper= s.c index a6aa59e4e6..e81e831c85 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -15,6 +15,14 @@ =20 #include "migration-helpers.h" =20 +/* + * Number of seconds we wait when looking for migration + * status changes, to avoid test suite hanging forever + * when things go wrong. Needs to be higher enough to + * avoid false positives on loaded hosts. + */ +#define MIGRATION_STATUS_WAIT_TIMEOUT 120 + bool got_stop; =20 static void check_stop_event(QTestState *who) @@ -166,8 +174,11 @@ static bool check_migration_status(QTestState *who, co= nst char *goal, void wait_for_migration_status(QTestState *who, const char *goal, const char **ungoals) { + g_test_timer_start(); while (!check_migration_status(who, goal, ungoals)) { usleep(1000); + + g_assert(g_test_timer_elapsed() < MIGRATION_STATUS_WAIT_TIMEOUT); } } =20 @@ -178,6 +189,7 @@ void wait_for_migration_complete(QTestState *who) =20 void wait_for_migration_fail(QTestState *from, bool allow_active) { + g_test_timer_start(); QDict *rsp_return; char *status; bool failed; @@ -193,6 +205,8 @@ void wait_for_migration_fail(QTestState *from, bool all= ow_active) g_assert(result); failed =3D !strcmp(status, "failed"); g_free(status); + + g_assert(g_test_timer_elapsed() < MIGRATION_STATUS_WAIT_TIMEOUT); } while (!failed); =20 /* Is the machine currently running? */ --=20 2.36.1 From nobody Sun Feb 8 16:06:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656413949363658.449966744929; Tue, 28 Jun 2022 03:59:09 -0700 (PDT) Received: from localhost ([::1]:37930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o68w0-00087v-Ba for importer@patchew.org; Tue, 28 Jun 2022 06:59:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rl-0000H2-Ud for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:46992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rk-0006Tc-HD for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:45 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-201-ZK5DJT35OCKiwPO2hIKVwA-1; Tue, 28 Jun 2022 06:54:41 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 38A6729ABA09; Tue, 28 Jun 2022 10:54:41 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DF31112131B; Tue, 28 Jun 2022 10:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656413683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IvQs1BTzvWIjCmhXB6wjFQJ4T4ocSbMzevflX82R/04=; b=LTy5G9EIXIHFaDM/0qpQwLHVWdGmE3aphJSjYZuSXnrot7dyeiG2PimNuioiF/ViGPOUAI lqy9ugJBFPgAiARHlgLPKAA5kZ7Q6e9hGFK1hCvEufZysCZ+6RNtx0blUNu8idq4nuC/sG YPxdqzb5J+XH3PBj6cf9oepafNzCPfg= X-MC-Unique: ZK5DJT35OCKiwPO2hIKVwA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Laurent Vivier , Juan Quintela , Thomas Huth , Cornelia Huck , qemu-s390x@nongnu.org, "Dr. David Alan Gilbert" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 2/5] tests: wait for migration completion before looking for STOP event Date: Tue, 28 Jun 2022 11:54:31 +0100 Message-Id: <20220628105434.295905-3-berrange@redhat.com> In-Reply-To: <20220628105434.295905-1-berrange@redhat.com> References: <20220628105434.295905-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656413950931100001 When moving into the convergance phase, the precopy tests will first look for a STOP event and once found will look for migration completion status. If the test VM is not converging, the test suite will be waiting for the STOP event forever. If we wait for the migration completion status first, then we will trigger the previously added timeout and prevent the test hanging forever. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Laurent Vivier Tested-by: Thomas Huth --- tests/qtest/migration-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index d33e8060f9..ac9e303b1f 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1232,6 +1232,10 @@ static void test_precopy_common(MigrateCommon *args) =20 migrate_set_parameter_int(from, "downtime-limit", CONVERGE_DOWNTIM= E); =20 + /* We do this first, as it has a timeout to stop us + * hanging forever if migration didn't converge */ + wait_for_migration_complete(from); + if (!got_stop) { qtest_qmp_eventwait(from, "STOP"); } @@ -1239,7 +1243,6 @@ static void test_precopy_common(MigrateCommon *args) qtest_qmp_eventwait(to, "RESUME"); =20 wait_for_serial("dest_serial"); - wait_for_migration_complete(from); } =20 if (args->finish_hook) { --=20 2.36.1 From nobody Sun Feb 8 16:06:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656413951499350.46305250328294; Tue, 28 Jun 2022 03:59:11 -0700 (PDT) Received: from localhost ([::1]:38126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o68w2-0008H9-Fv for importer@patchew.org; Tue, 28 Jun 2022 06:59:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rp-0000QW-N1 for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47968) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68ro-0006VD-6u for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:49 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-35-rDG00xkeO460cGX1RJ0wSQ-1; Tue, 28 Jun 2022 06:54:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F161F1C01B43; Tue, 28 Jun 2022 10:54:42 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C217112131B; Tue, 28 Jun 2022 10:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656413687; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vGQc0o2rUAOpzO5qCDKBngWg/G2HM9Kn7KYqBqNXvps=; b=QT8nYNC6NAF8cVZ4j6IcdGY+vBTNwF1yZzD5zW1EgBggoVKdyTCtfEVw2jhRehuaNUp9J4 uRZc8ACfWMuxpyL45XdTzSHACQTHJYxhT07iQPIBQi7a7oZypileBrmTmgfWom9EsIR+IZ 2zQKzG9I6oxTwIwKSJuYxQMPW8NcORM= X-MC-Unique: rDG00xkeO460cGX1RJ0wSQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Laurent Vivier , Juan Quintela , Thomas Huth , Cornelia Huck , qemu-s390x@nongnu.org, "Dr. David Alan Gilbert" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 3/5] tests: increase migration test converge downtime to 30 seconds Date: Tue, 28 Jun 2022 11:54:32 +0100 Message-Id: <20220628105434.295905-4-berrange@redhat.com> In-Reply-To: <20220628105434.295905-1-berrange@redhat.com> References: <20220628105434.295905-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656413952932100003 While 1 second might be enough to converge migration on a fast host, this is not guaranteed, especially if using TLS in the tests without hardware accelerated crypto available. Increasing the downtime to 30 seconds should guarantee it can converge in any sane scenario. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laurent Vivier Tested-by: Thomas Huth --- tests/qtest/migration-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index ac9e303b1f..a54eff6d56 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -47,7 +47,7 @@ unsigned end_address; static bool uffd_feature_thread_id; =20 /* A downtime where the test really should converge */ -#define CONVERGE_DOWNTIME 1000 +#define CONVERGE_DOWNTIME (1000 * 30) =20 #if defined(__linux__) #include --=20 2.36.1 From nobody Sun Feb 8 16:06:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656413849285511.3777846267941; Tue, 28 Jun 2022 03:57:29 -0700 (PDT) Received: from localhost ([::1]:59834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o68uO-0003dK-8T for importer@patchew.org; Tue, 28 Jun 2022 06:57:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rr-0000TM-2X for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:60229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rp-0006WV-7h for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:50 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-341-ab8f7mVfOkakMVRDHxtKFg-1; Tue, 28 Jun 2022 06:54:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1D458811E76; Tue, 28 Jun 2022 10:54:45 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42AE0112131B; Tue, 28 Jun 2022 10:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656413688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kaoBvyqnmaBx57AzM7IDHSb4QRZiZyWXZZIh24Icw28=; b=L5eXtmiTbks5PRmbeHdQaDBrGZVJKRqhIC0UjVzTWTpOfMILIC5wl1uAsgMDy7hqs37VIS Mh2Pd/rLNnjNsX1utWvy9OY+0g79rh95u5LoJARrw1poj7OTrwdGj83sPk/XReRE6z4K6x VaVe7kfXKzAKodQzslefY6+2G1qYLxk= X-MC-Unique: ab8f7mVfOkakMVRDHxtKFg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Laurent Vivier , Juan Quintela , Thomas Huth , Cornelia Huck , qemu-s390x@nongnu.org, "Dr. David Alan Gilbert" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 4/5] tests: use consistent bandwidth/downtime limits in migration tests Date: Tue, 28 Jun 2022 11:54:33 +0100 Message-Id: <20220628105434.295905-5-berrange@redhat.com> In-Reply-To: <20220628105434.295905-1-berrange@redhat.com> References: <20220628105434.295905-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656413850182100003 The different migration test cases are using a variety of settings to ensure convergance/non-convergance. Introduce two helpers to extra the common functionality and ensure consistency. * Non-convergance: 1ms downtime, 30mbs bandwidth * Convergance: 30s downtime, 1gbs bandwidth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Dr. David Alan Gilbert Tested-by: Thomas Huth --- tests/qtest/migration-test.c | 54 +++++++++++++----------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index a54eff6d56..9e64125f02 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -46,9 +46,6 @@ unsigned start_address; unsigned end_address; static bool uffd_feature_thread_id; =20 -/* A downtime where the test really should converge */ -#define CONVERGE_DOWNTIME (1000 * 30) - #if defined(__linux__) #include #include @@ -402,6 +399,20 @@ static void migrate_set_parameter_str(QTestState *who,= const char *parameter, migrate_check_parameter_str(who, parameter, value); } =20 +static void migrate_ensure_non_converge(QTestState *who) +{ + /* Can't converge with 1ms downtime + 30 mbs bandwidth limit */ + migrate_set_parameter_int(who, "max-bandwidth", 30 * 1000 * 1000); + migrate_set_parameter_int(who, "downtime-limit", 1); +} + +static void migrate_ensure_converge(QTestState *who) +{ + /* Should converge with 30s downtime + 1 gbs bandwidth limit */ + migrate_set_parameter_int(who, "max-bandwidth", 1 * 1000 * 1000 * 1000= ); + migrate_set_parameter_int(who, "downtime-limit", 30 * 1000); +} + static void migrate_pause(QTestState *who) { QDict *rsp; @@ -984,12 +995,7 @@ static int migrate_postcopy_prepare(QTestState **from_= ptr, migrate_set_capability(to, "postcopy-ram", true); migrate_set_capability(to, "postcopy-blocktime", true); =20 - /* We want to pick a speed slow enough that the test completes - * quickly, but that it doesn't complete precopy even on a slow - * machine, so also set the downtime. - */ - migrate_set_parameter_int(from, "max-bandwidth", 30000000); - migrate_set_parameter_int(from, "downtime-limit", 1); + migrate_ensure_non_converge(from); =20 /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); @@ -1188,15 +1194,7 @@ static void test_precopy_common(MigrateCommon *args) return; } =20 - /* - * We want to pick a speed slow enough that the test completes - * quickly, but that it doesn't complete precopy even on a slow - * machine, so also set the downtime. - */ - /* 1 ms should make it not converge*/ - migrate_set_parameter_int(from, "downtime-limit", 1); - /* 1GB/s */ - migrate_set_parameter_int(from, "max-bandwidth", 1000000000); + migrate_ensure_non_converge(from); =20 if (args->start_hook) { data_hook =3D args->start_hook(from, to); @@ -1230,7 +1228,7 @@ static void test_precopy_common(MigrateCommon *args) wait_for_migration_pass(from); } =20 - migrate_set_parameter_int(from, "downtime-limit", CONVERGE_DOWNTIM= E); + migrate_ensure_converge(from); =20 /* We do this first, as it has a timeout to stop us * hanging forever if migration didn't converge */ @@ -1694,8 +1692,7 @@ static void test_migrate_auto_converge(void) * Set the initial parameters so that the migration could not converge * without throttling. */ - migrate_set_parameter_int(from, "downtime-limit", 1); - migrate_set_parameter_int(from, "max-bandwidth", 100000000); /* ~100Mb= /s */ + migrate_ensure_non_converge(from); =20 /* To check remaining size after precopy */ migrate_set_capability(from, "pause-before-switchover", true); @@ -2000,15 +1997,7 @@ static void test_multifd_tcp_cancel(void) return; } =20 - /* - * We want to pick a speed slow enough that the test completes - * quickly, but that it doesn't complete precopy even on a slow - * machine, so also set the downtime. - */ - /* 1 ms should make it not converge*/ - migrate_set_parameter_int(from, "downtime-limit", 1); - /* 300MB/s */ - migrate_set_parameter_int(from, "max-bandwidth", 30000000); + migrate_ensure_non_converge(from); =20 migrate_set_parameter_int(from, "multifd-channels", 16); migrate_set_parameter_int(to, "multifd-channels", 16); @@ -2054,10 +2043,7 @@ static void test_multifd_tcp_cancel(void) =20 wait_for_migration_status(from, "cancelled", NULL); =20 - /* 300ms it should converge */ - migrate_set_parameter_int(from, "downtime-limit", 300); - /* 1GB/s */ - migrate_set_parameter_int(from, "max-bandwidth", 1000000000); + migrate_ensure_converge(from); =20 migrate_qmp(from, uri, "{}"); =20 --=20 2.36.1 From nobody Sun Feb 8 16:06:15 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656413861782189.59429385109536; Tue, 28 Jun 2022 03:57:41 -0700 (PDT) Received: from localhost ([::1]:60728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o68ua-0004Fv-3i for importer@patchew.org; Tue, 28 Jun 2022 06:57:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rs-0000XB-Ke for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:32885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o68rr-0006XE-3X for qemu-devel@nongnu.org; Tue, 28 Jun 2022 06:54:52 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-343-8omwsF04Ofi14cKPaE7QEA-1; Tue, 28 Jun 2022 06:54:47 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0823D801233; Tue, 28 Jun 2022 10:54:47 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75C18112131B; Tue, 28 Jun 2022 10:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656413690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TMHKYNA+glh4I0uMHgBY5dUYGmUujwoTHdWDTL53EV0=; b=FiawDveUN1ZIH5hvmMDSW0heJ3iuhDg4X98T3syNBEUan93VJvz9tp9eIaphfSpnsc737r prNOB19z+ISqtIOz3hhekWAecPY0ODXBW9eFFXilN1ocgcizD4oRW5nFMYBvt9yyBOljWC VJ+cWUMT2aXgm1gJfMu6zbfbt/+QzaA= X-MC-Unique: 8omwsF04Ofi14cKPaE7QEA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Laurent Vivier , Juan Quintela , Thomas Huth , Cornelia Huck , qemu-s390x@nongnu.org, "Dr. David Alan Gilbert" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [RFC PATCH 5/5] tests: stop skipping migration test on s390x/ppc64 Date: Tue, 28 Jun 2022 11:54:34 +0100 Message-Id: <20220628105434.295905-6-berrange@redhat.com> In-Reply-To: <20220628105434.295905-1-berrange@redhat.com> References: <20220628105434.295905-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656413862333100001 There have been checks put into the migration test which skip it in a few scenarios * ppc64 TCG * ppc64 KVM with kvm-pr * s390x TCG In the original commits there are references to unexplained hangs in the test. There is no record of details of where it was hanging, but it is suspected that these were all a result of the max downtime limit being set at too low a value to guarantee convergance. Since a previous commit bumped the value from 1 second to 30 seconds, it is believed that hangs due to non-convergance should be eliminated and thus worth trying to remove the skipped scenarios. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Thomas Huth Tested-by: Thomas Huth --- tests/qtest/migration-test.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 9e64125f02..500169f687 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2085,7 +2085,6 @@ static bool kvm_dirty_ring_supported(void) int main(int argc, char **argv) { char template[] =3D "/tmp/migration-test-XXXXXX"; - const bool has_kvm =3D qtest_has_accel("kvm"); int ret; =20 g_test_init(&argc, &argv, NULL); @@ -2094,26 +2093,6 @@ int main(int argc, char **argv) return g_test_run(); } =20 - /* - * On ppc64, the test only works with kvm-hv, but not with kvm-pr and = TCG - * is touchy due to race conditions on dirty bits (especially on PPC f= or - * some reason) - */ - if (g_str_equal(qtest_get_arch(), "ppc64") && - (!has_kvm || access("/sys/module/kvm_hv", F_OK))) { - g_test_message("Skipping test: kvm_hv not available"); - return g_test_run(); - } - - /* - * Similar to ppc64, s390x seems to be touchy with TCG, so disable it - * there until the problems are resolved - */ - if (g_str_equal(qtest_get_arch(), "s390x") && !has_kvm) { - g_test_message("Skipping test: s390x host with KVM is required"); - return g_test_run(); - } - tmpfs =3D mkdtemp(template); if (!tmpfs) { g_test_message("mkdtemp on path (%s): %s", template, strerror(errn= o)); --=20 2.36.1