From nobody Thu Nov 30 23:48:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ShCZS41Xrz52yjN; Thu, 30 Nov 2023 23:48:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ShCZS3Rgyz3gvL; Thu, 30 Nov 2023 23:48:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701388128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LOQUeDpdxw9UjKzj3E9zwkkpfBe7vQITvM3sCR9efW8=; b=NiPImWMdzpqYpF/tY86Bulma/qKIcTA/238SuhrFf9ORASTHLmaqVKU944KSGCuQ1mkWRB /J1yliCft2nFDG5KlUIi8CbOqbJHG1Id7dxYavovG8naI6AKwf9qhLZhFFzl65A+N7Lcsx OkHNZarfPGf/PP6LOKNAw7/IBZEvmZjaMyxo+BiljG7ONmpilVNrm8/LX656X5yZEOQGOl U4yHspKrxXve6JP09b1h4A0W7BTaExxpIcmCcOgW7n2NLHvvrVSD57fyovBemFsZim/kRZ dvu94bGkXFPNLU/IMuz9u+biDBMIlmHwN7NQTjVVNWfuNQOwQXB9qqnAsnIosA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701388128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LOQUeDpdxw9UjKzj3E9zwkkpfBe7vQITvM3sCR9efW8=; b=uRj9wpRFKGq7LYTo1fk7MQRnCygE6ncoTpGtSTW3+V2CZtOTdOpN/ai6XA8BP+/V17sN9y FfOUG6PIZFVRqjZyGU61XJ4X3Ma2X2R0qD0FjAcdWe+Th4od0VJoTOqr4ZABk4oLdQSODP Wh4j0znhKP3ew1cd8fmkmmFpboLJ5KhEY5u3BFHs6fdiO51OstxehiujEouYZp3UfmOot1 lYnxBomr0PaUq/LCr73NEc2UpI6NsNG6WuLLr2vC+M8a6SxhRF785SCuElUns+Iu4AmRCa BSZD/fqDCZFIfLe2SCXjlyMCl+rG21gjNiCgJkNUEiF/3q/V9gqDm02R+qqgcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701388128; a=rsa-sha256; cv=none; b=gq3j1hQ88gZ3iiaJpOD78OGy/ZKBYEZzChEa7OIB3voeg6q/OQrKKR/zqtoFjPYrx7PQj8 VLhbS+iVu10ZZ08It0W3JUqyJYTBdC87QBbpxY0zCfeKI6WwfqdJaT459wgukCDheYh/Dx c8WNqTbOyLcn6OX/Giz2qu86lAaUwMGs5Gb9/d8IRViob6s98zxS/MMA+KAuWzKJ1xYmro CN25GUWcRiBRaXK8/Rkiznx9cifPqo0ThcXG0IZXkBqToioerlrDDIu0zZufW/bVpnD8pv lbfOrxPVFIWpfrMAnIy4ij8GCbbgZo4RtKzsohLsxNA/JYJvN0t+aEI8OILg7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ShCZS2Rgrz18N0; Thu, 30 Nov 2023 23:48:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AUNmmne073032; Thu, 30 Nov 2023 23:48:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AUNmmFf073029; Thu, 30 Nov 2023 23:48:48 GMT (envelope-from git) Date: Thu, 30 Nov 2023 23:48:48 GMT Message-Id: <202311302348.3AUNmmFf073029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 8b7963aeb576 - stable/13 - Fix intermittency in the sys.fs.fusefs.mknod.main test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8b7963aeb576a78214f11358113d2a159fccf1b3 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=8b7963aeb576a78214f11358113d2a159fccf1b3 commit 8b7963aeb576a78214f11358113d2a159fccf1b3 Author: Alan Somers AuthorDate: 2023-10-06 19:46:42 +0000 Commit: Alan Somers CommitDate: 2023-11-30 20:42:46 +0000 Fix intermittency in the sys.fs.fusefs.mknod.main test In the Mknod.parent_inode test case, the kernel sends an extra FUSE_FORGET message. But because it gets sent asynchronously with the failing syscall, it doesn't always get received before the test ends. So we never setup an expectation for it. And 90+% of the time the test would exit successfully. Fix the intermittency by always waiting to receive the FUSE_FORGET message. Sponsored by: Axcient (cherry picked from commit 86885b18689889e9b9142fd31d8c67f21334ba32) Fix intermittency in the sys.fs.fusefs.symlink.main test This change is identical to 86885b18689 but for symlink instead of mknod. The kernel sends a FUSE_FORGET asynchronously with the final syscall. The lack of an expectation caused this test to occasionally fail. Also, remove a sleep that accidentally snuck into a different test. Sponsored by: Axcient (cherry picked from commit 8399d764c929a4b2fa98dbfae0ca7359810e4668) --- tests/sys/fs/fusefs/mkdir.cc | 1 - tests/sys/fs/fusefs/mknod.cc | 7 +++++++ tests/sys/fs/fusefs/symlink.cc | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/sys/fs/fusefs/mkdir.cc b/tests/sys/fs/fusefs/mkdir.cc index 48453ff8bb8a..f020feb94ed8 100644 --- a/tests/sys/fs/fusefs/mkdir.cc +++ b/tests/sys/fs/fusefs/mkdir.cc @@ -241,7 +241,6 @@ TEST_F(Mkdir, parent_inode) ASSERT_EQ(-1, mkdir(FULLPATH, mode)); ASSERT_EQ(EIO, errno); - usleep(100000); } TEST_F(Mkdir_7_8, ok) diff --git a/tests/sys/fs/fusefs/mknod.cc b/tests/sys/fs/fusefs/mknod.cc index 223d38f8acb1..1fb855f44f29 100644 --- a/tests/sys/fs/fusefs/mknod.cc +++ b/tests/sys/fs/fusefs/mknod.cc @@ -32,6 +32,7 @@ extern "C" { #include #include #include +#include } #include "mockfs.hh" @@ -255,14 +256,18 @@ TEST_F(Mknod, parent_inode) const char RELPATH[] = "some_node"; mode_t mode = S_IFSOCK | 0755; struct sockaddr_un sa; + sem_t sem; int fd; dev_t rdev = -1; /* Really it's a don't care */ uint64_t ino = 42; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(PPATH, ino, S_IFDIR | 0755, 0, 1); EXPECT_LOOKUP(ino, RELPATH) .WillOnce(Invoke(ReturnErrno(ENOENT))); expect_mknod(ino, RELPATH, ino, mode, rdev); + expect_forget(ino, 1, &sem); fd = socket(AF_UNIX, SOCK_STREAM, 0); ASSERT_LE(0, fd) << strerror(errno); @@ -273,6 +278,8 @@ TEST_F(Mknod, parent_inode) ASSERT_EQ(EIO, errno); leak(fd); + sem_wait(&sem); + sem_destroy(&sem); } /* diff --git a/tests/sys/fs/fusefs/symlink.cc b/tests/sys/fs/fusefs/symlink.cc index 19286a446fc3..bd355497a8bd 100644 --- a/tests/sys/fs/fusefs/symlink.cc +++ b/tests/sys/fs/fusefs/symlink.cc @@ -29,6 +29,7 @@ */ extern "C" { +#include #include } @@ -174,15 +175,22 @@ TEST_F(Symlink, parent_ino) const char PPATH[] = "parent"; const char RELPATH[] = "src"; const char dst[] = "dst"; + sem_t sem; const uint64_t ino = 42; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(PPATH, ino, S_IFDIR | 0755, 0, 1); EXPECT_LOOKUP(ino, RELPATH) .WillOnce(Invoke(ReturnErrno(ENOENT))); expect_symlink(ino, dst, RELPATH); + expect_forget(ino, 1, &sem); EXPECT_EQ(-1, symlink(dst, FULLPATH)); EXPECT_EQ(EIO, errno); + + sem_wait(&sem); + sem_destroy(&sem); } TEST_F(Symlink_7_8, ok)