From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 13BB61F4CA for ; Fri, 15 Nov 2024 02:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1731639573; bh=jN82K/Za77sceLVk1YDhDIZXi+SleShDVWpK1bD1WgY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=C80MkR5/++FL5hV3glJdRMyI/4W9dpcpLC8skJlVoo+2hxkmHKwzLMGaTgu36pxuF kxfKuFacdLvY4iEldVIeSql5LSruDJeXIxijo4RT6SMC62qKxpyZiBz2meqam4VJ2F xzY8HcznxD48nCqykstkk7KZM8oA/rfDy+cdMHfI= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/6] test_common: disable fsync in git(1) commands Date: Fri, 15 Nov 2024 02:59:28 +0000 Message-ID: <20241115025932.1647240-3-e@80x24.org> In-Reply-To: <20241115025932.1647240-1-e@80x24.org> References: <20241115025932.1647240-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: As with git itself, fsync(2) results in needless overhead and storage wear in test cases where data integrity is not an issue. I normally point TMPDIR to tmpfs when running tests, but this still affects initial setup of data for stuff in t/data-gen as well as improving life for users with too little RAM for a tmpfs TMPDIR. --- lib/PublicInbox/TestCommon.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 6c3677d2..b863ad6b 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -18,6 +18,7 @@ our $tail_cmd = $ENV{TAIL}; our ($lei_opt, $lei_out, $lei_err); use autodie qw(chdir close fcntl mkdir open opendir seek unlink); $ENV{XDG_CACHE_HOME} //= "$ENV{HOME}/.cache"; # reuse C++ xap_helper builds +$ENV{GIT_TEST_FSYNC} = 0; # hopefully reduce wear $_ = File::Spec->rel2abs($_) for (grep(!m!^/!, @INC)); our $CURRENT_DAEMON; @@ -87,6 +88,7 @@ sub tmpdir (;$) { my ($base) = @_; require File::Temp; ($base) = ($0 =~ m!\b([^/]+)\.[^\.]+\z!) unless defined $base; + ($base) = ($0 =~ m!\b([^/]+)\z!) unless defined $base; my $tmpdir = File::Temp->newdir("pi-$base-$$-XXXX", TMPDIR => 1); wantarray ? ($tmpdir->dirname, $tmpdir) : $tmpdir; }