From patchwork Fri Jan 26 11:23:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 766338 Delivered-To: patch@linaro.org Received: by 2002:adf:a314:0:b0:337:62d3:c6d5 with SMTP id c20csp176583wrb; Fri, 26 Jan 2024 03:23:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+1duOq19zIdH6L4LTwYvG0BCjrJTAYymrpU/jMHDTD/IpJm4KafgzBrRBMQazGtS+piIl X-Received: by 2002:ac8:5810:0:b0:42a:5d5b:33c5 with SMTP id g16-20020ac85810000000b0042a5d5b33c5mr1449719qtg.120.1706268239089; Fri, 26 Jan 2024 03:23:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706268239; cv=pass; d=google.com; s=arc-20160816; b=X2i9YB5gRMRz4Aw34h2YYk8sWoZHEoxLU0wAjpIifkpA9zgZnIVflDavLbByNO6I0c 6R7sVOoWIyLYjXZsoIKQq8L/VRqXPhrFWrhQzRdgXq00RLnhv5Oc46gYF6yxh4I20oVN rTR+fftZLSsk9wVHui8kj/e/J5O017jy5ckklkON3IklZwAsfCR6RO5KuQMtiQdrf7L5 ISqH+QspPti4f0F4cB/5+ZYQm66U/OvOvPv8GvKLzKnVKVN3IyMUgZgGbH7Am6/PHjI7 SzEZshRaV/lk1VDASQqMtYjU6bnBhrGxCWtSEwGYH4fJrQ/4/nypUKlITkyOOEw+QKwi ml+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=HgKG3PyGzuQ31tSPdd9W2zDBP/MUcsL80S4SABtY3Ac=; fh=UCVZ7S1lBcEAg62ZuvyIjHIDpE1rX0WJm+RYA5LwILk=; b=SdUz4OvaSoI1+3Qg6ehEhq/OqVKPGirE8YKJAs+VWMHgMaoiKIXdSH4ToovMddsSRN wgvWEWxV4zvp0CLSCTKsK523i7ABJiJxtCTFx/IqdfdekpbkftG7IFHaMDx2KBuO/pEJ 83rc9H9Qqy0ipMgOffSkE+MGIj1+LPWtupevM+QfZjwpHZzXF4GAQw7KNNadvtzKdtyt Ldpj7/AW+f6LL/4s3QDKazlO91ipaYoAyAEcZIIrRrTEFQCLW26mSoC+sel8RmznwjC7 JybK+fjKLC2X+FdymP6rg+PhkCpWKOR4xblzz4ca1NIEnQO4kDb1zuj1/ZPIFmEg7Ma7 Tx2w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Dq/htjI/"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n6-20020a05622a040600b004299526a77dsi960400qtx.792.2024.01.26.03.23.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 03:23:59 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Dq/htjI/"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 56B7638582AA for ; Fri, 26 Jan 2024 11:23:58 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 159A63858C74 for ; Fri, 26 Jan 2024 11:23:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 159A63858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 159A63858C74 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706268228; cv=none; b=FrG6FU3KeaDUZ1mLMvnpa38WxPtt6KDBPi0pVE9XT9YeqMUqoXfgTW4yvjpsXpWlNyWDI/MoZrmcpAS4gzYB/0W8+IjnLJk+nsHNrXsoiVr744SwAANRO3SL/zOp+qjvdRDdXAPVp5oya+llP2bwuc9Pm8byAYns01TvMsQQbHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706268228; c=relaxed/simple; bh=REJj/K9B2OGKk0q1C77b2sXQY5j4W8mEnXBwz4aA5k0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=HaafBL5VnuiGV94NcIJ48/mb0uA37kaBHAzleWNPO5w6ujQ5pdvGS8x8aTM3Ocn6145boRa6xns04SDUXKrg+LWPJWRXPZez7cwH+cqG+XDgNiVx9I13LBshXZGUxSGsC9Ybezn/a3UwapUhP5E+daTiA7rBrPIj0CK+IHEy1hI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5d4a1e66750so463086a12.0 for ; Fri, 26 Jan 2024 03:23:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706268225; x=1706873025; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HgKG3PyGzuQ31tSPdd9W2zDBP/MUcsL80S4SABtY3Ac=; b=Dq/htjI/xLguu8nwMS0fo6bt4+kVcrwnK/8EbBpuLjKJLj1Lst2X0f7H7+OGFzQ6HR DAf8TmDjuE5jXX913jseI/7rs/1HzNN5JhOKOh2OKrV7gr5QaNg+QztvpNXmhFDilfCn TKwZBuUwD2Ii813ON6WrUbSCt33p0SIeM6SkJQB0otdGBLHi3apR7VN7KTjmhZY7rjmY n2tg8kh+plkazRO5CQq5nYZ6AQDzDjoyRqJiO7xwx3jIfAPjlKqkEwXq3zPvMH55IjZu qPJmrf3hs8xNX9npZLXlqz7PCkoYe2qwTa+xIdd7FHC59qaBQDJMa+vkx+QxDpr9hLO6 tj2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706268225; x=1706873025; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HgKG3PyGzuQ31tSPdd9W2zDBP/MUcsL80S4SABtY3Ac=; b=oqpaLfvgwQGle63pQNqbBz4+3GDISpvUH7nXr1/snn9yO0MI5HRuCPG0cwDKsuHq2z MCRnntP/Syhh/mNX0mbKAJnlGejQlDVDAY8Ebj5ZyWMdDYP/ADFreA4SvCjpHcYoKqzY IQ6k9lcwiHUzxvLeZjkKYycZC+K7mbT6lzNgpkm0Kr4pX5+xIcBQmOmG+yZH3ymfPyKR NRHzI04wr+Khis0F+Jidss22a/6cQYK2tI+WH6peapTfW1knmofJaUaCC1cHjupqMrTa D7HRxsGyYgYSXr/K9X9PxGKPh9YiX05zmDYpySchZ8Rgioajg7yg3hrC1GxGYoIath/M /AtQ== X-Gm-Message-State: AOJu0Yy5pDdNZmEoByMmCw9iYWUsTQEaisq8mIKXQTMDt8JbZNz+HbQm tFHKoBeBAek8vkEAXoQ6aoK7I2g/yQqxDnNEmlTquV/7muN+hfRMRON14N6rfdTcP9XCxM1eCho q X-Received: by 2002:a05:6a20:d392:b0:19c:8f85:84b9 with SMTP id iq18-20020a056a20d39200b0019c8f8584b9mr219602pzb.35.1706268225441; Fri, 26 Jan 2024 03:23:45 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:c10c:6bbe:23a4:fba4:865e]) by smtp.gmail.com with ESMTPSA id t3-20020a17090a950300b00290a26531f5sm2991573pjo.7.2024.01.26.03.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 03:23:44 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Aurelien Jarno Subject: [PATCH] misc: tst-poll: Proper synchronize with child before sending the signal Date: Fri, 26 Jan 2024 08:23:41 -0300 Message-Id: <20240126112341.2286758-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org When running the testsuite in parallel, for instance running make -j $(nproc) check, occasionally tst-epoll fails with a timeout. It happens because it sometimes takes a bit more than 10ms for the process to get cloned and blocked by the syscall. In that case the signal is sent to early, and the test fails with a timeout. Checked on x86_64-linux-gnu. Tested-by: Aurelien Jarno --- sysdeps/unix/sysv/linux/tst-epoll.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysdeps/unix/sysv/linux/tst-epoll.c b/sysdeps/unix/sysv/linux/tst-epoll.c index 3b38beae6e..545f506faa 100644 --- a/sysdeps/unix/sysv/linux/tst-epoll.c +++ b/sysdeps/unix/sysv/linux/tst-epoll.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -97,8 +97,8 @@ test_epoll_basic (epoll_wait_check_t epoll_wait_check) xclose (fds[0][0]); xclose (fds[1][1]); - /* Wait some time so child is blocked on the syscall. */ - nanosleep (&(struct timespec) {0, 10000000}, NULL); + /* Wait until child is blocked on epoll_wait. */ + support_process_state_wait (p, support_process_state_sleeping); TEST_COMPARE (kill (p, SIGUSR1), 0); int e = epoll_wait_check (efd, &event, 1, 500000000, &ss);