From nobody Wed Nov 5 15:00:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1535038292260224.71106297427934; Thu, 23 Aug 2018 08:31:32 -0700 (PDT) Received: from localhost ([::1]:37266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsra6-0002th-Vc for importer@patchew.org; Thu, 23 Aug 2018 11:31:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsqed-0001Xj-Us for qemu-devel@nongnu.org; Thu, 23 Aug 2018 10:32:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsqed-0004L5-2q for qemu-devel@nongnu.org; Thu, 23 Aug 2018 10:32:07 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36140 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsqec-0004Kb-P6 for qemu-devel@nongnu.org; Thu, 23 Aug 2018 10:32:06 -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 mx1.redhat.com (Postfix) with ESMTPS id 70ED97A7E9 for ; Thu, 23 Aug 2018 14:32:06 +0000 (UTC) Received: from localhost (ovpn-112-25.ams2.redhat.com [10.36.112.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29A8E1010419; Thu, 23 Aug 2018 14:32:01 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 23 Aug 2018 16:31:24 +0200 Message-Id: <20180823143125.16767-5-marcandre.lureau@redhat.com> In-Reply-To: <20180823143125.16767-1-marcandre.lureau@redhat.com> References: <20180823143125.16767-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 23 Aug 2018 14:32:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 23 Aug 2018 14:32:06 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcandre.lureau@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 4/5] test-char: fix random socket test failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , peterx@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Peter reported a test failure on FreeBSD with the new reconnect test: MALLOC_PERTURB_=3D${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} gtester -k --verbose -m=3Dquick tests/test-char TEST: tests/test-char... (pid=3D16190) /char/null: OK /char/invalid: OK /char/ringbuf: OK /char/mux: OK /char/stdio: OK /char/pipe: OK /char/file: OK /char/file-fifo: OK /char/udp: OK /char/serial: OK /char/hotswap: OK /char/socket/basic: OK /char/socket/reconnect: FAIL GTester: last random seed: R02S521380d9c12f1dac3ad1763bf5665c27 (pid=3D16367) /char/socket/fdpass: OK FAIL: tests/test-char ** ERROR:tests/test-char.c:353:char_socket_test_common: assertion failed: (object_property_get_bool(OBJECT(chr_client), "connected", &error_abort)) It turns out that the socket test code checks both server and client connection states, but doesn't wait for both. Wait for the client side as well. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Paolo Bonzini --- tests/test-char.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test-char.c b/tests/test-char.c index 5905d31441..2b1e400542 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -349,6 +349,12 @@ static void char_socket_test_common(Chardev *chr) g_assert_cmpint(id, >, 0); main_loop(); =20 + d.chr =3D chr_client; + id =3D g_idle_add(char_socket_test_idle, &d); + g_source_set_name_by_id(id, "test-idle"); + g_assert_cmpint(id, >, 0); + main_loop(); + g_assert(object_property_get_bool(OBJECT(chr), "connected", &error_abo= rt)); g_assert(object_property_get_bool(OBJECT(chr_client), "connected", &error_abort)); @@ -358,6 +364,7 @@ static void char_socket_test_common(Chardev *chr) =20 object_unparent(OBJECT(chr_client)); =20 + d.chr =3D chr; d.conn_expected =3D false; g_idle_add(char_socket_test_idle, &d); main_loop(); --=20 2.18.0.547.g1d89318c48