Message ID | ZwbBsRv2fyVbKWkc@elastic.org |
---|---|
State | Committed |
Headers |
Return-Path: <elfutils-devel-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C1C57385E82D for <patchwork@sourceware.org>; Wed, 9 Oct 2024 17:47:41 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from elastic.org (elastic.org [96.126.110.187]) by sourceware.org (Postfix) with ESMTPS id F14403858417 for <elfutils-devel@sourceware.org>; Wed, 9 Oct 2024 17:47:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F14403858417 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=elastic.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=elastic.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F14403858417 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=96.126.110.187 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728496052; cv=none; b=b8nINGJqN7uxFs7AozXewX62fmyTRvU8cfs60OpirzO5IKZQKwAsEIt0meWmPf/XYcPu64YfhkByxwVSY084gDEUu7XHJhf4i+A6LP910W575oXHYP2+vdmY0Tle4ZnUk2kMiqAocH4/ZduaSF8NkvzZ987/0rgIkhfjRrpC3W0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728496052; c=relaxed/simple; bh=ghZA80aBnFwbCih0iEsEHS7w0/V1W86SNtAyA9nO3EU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Y1c+NW5jNi2t7f0cUlaokIEU+x620OCGKAYnAQ9DCIQEp65h29IqG4Q/o/CJJcjGnRC9Zw0H+6Jmq8WErnB099T1B+iwet7QYtnSwCw1+MMk5dJgS4/6M89DrmftFCtZFto8j8omOSxmMYnGKI763g+qgtVgiuewq0KZsN6U0iM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=elastic.org ; s=default2; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9HdOTm3hfiENoUEuAwyvTRrGUoV62EdmvH7/uroK/FY=; b=gYBWqxi41faQjT3ai6b8wz/J3t hPyzbcnnqG71ufCSNY582e+DjuXfBOyw433X9D6f5PdWuVqEljYzxsOM4V18kkzRNlBUzBk9fuoA8 AukUe70/0LCokVpJ+6wJXg0fVCE13OYYLSjf9mid4zWM14TEL7N24nHuzkSvrqqtNP2+ly6ox/rm/ FssGyhCK1Wlt/h4MqL6R5UMZhlodxlNsftPF1lRH2XnEiZtAHG3SV/4IvtpJi33P8614lHKk5CQ2x oRhkm+znmOFxiyMe07XGcsF+NDiKEvpMdt3NCKwfc9erEWZW42hsOlKZase6KWej2jUnQ3jJoclSc q+7CjfdA==; Received: from vpn-home.elastic.org ([10.0.0.2] helo=elastic.org) by elastic.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from <fche@elastic.org>) id 1syamY-000000005zJ-1OAS for elfutils-devel@sourceware.org; Wed, 09 Oct 2024 17:47:30 +0000 Received: from very.elastic.org ([192.168.1.1]) by elastic.org with esmtp (Exim 4.98) (envelope-from <fche@elastic.org>) id 1syamX-00000000SBO-2nTY for elfutils-devel@sourceware.org; Wed, 09 Oct 2024 13:47:29 -0400 Received: from fche by very.elastic.org with local (Exim 4.98) (envelope-from <fche@very.elastic.org>) id 1syamX-0000000AzUl-2Fns for elfutils-devel@sourceware.org; Wed, 09 Oct 2024 13:47:29 -0400 Date: Wed, 9 Oct 2024 13:47:29 -0400 From: "Frank Ch. Eigler" <fche@elastic.org> To: elfutils-devel@sourceware.org Subject: [patch] test tempdir move Message-ID: <ZwbBsRv2fyVbKWkc@elastic.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Sender-Verification: "" X-Spam-Status: No, score=-108.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP, USER_IN_WELCOMELIST, USER_IN_WHITELIST 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Elfutils-devel mailing list <elfutils-devel.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/elfutils-devel/> List-Post: <mailto:elfutils-devel@sourceware.org> List-Help: <mailto:elfutils-devel-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=subscribe> Errors-To: elfutils-devel-bounces~patchwork=sourceware.org@sourceware.org |
Series |
test tempdir move
|
|
Commit Message
Frank Ch. Eigler
Oct. 9, 2024, 5:47 p.m. UTC
Hi - I find the following patch makes make checks bearable again. From 0acce289fbb9c4da6a6ec1868eed5ede5a62e63d Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" <fche@redhat.com> Date: Wed, 9 Oct 2024 13:41:14 -0400 Subject: [PATCH] tests/test-subr.sh: Put test_dir under /var/tmp. Every individual test in elfutils involves a temporary directory. Previous version of this script put that directory under the build tree. That's OK if it's a local disk, but if it's on NFS, then some tests - run-large-elf-file.sh, several run-debuginfod-*.sh - take long enough to run to fail tests intermittently. This patch moves the temp_dir under ${TMPDIR-/var/tmp/}, so it operates at local disk speed rather than whatever-build-filesystem speed. Individual test scripts are all unaffected. (One could consider /tmp instead, which is a RAM disk on modern systems, except that some of the elfutils tests produce GB-sized temporary files. That's probably too big for RAM.) Signed-off-by: Frank Ch. Eigler <fche@redhat.com> --- tests/test-subr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Frank, On Wed, Oct 09, 2024 at 01:47:29PM -0400, Frank Ch. Eigler wrote: > I find the following patch makes make checks bearable again. I like the idea of this change. Some nitpicks below. > From 0acce289fbb9c4da6a6ec1868eed5ede5a62e63d Mon Sep 17 00:00:00 2001 > From: "Frank Ch. Eigler" <fche@redhat.com> > Date: Wed, 9 Oct 2024 13:41:14 -0400 > Subject: [PATCH] tests/test-subr.sh: Put test_dir under /var/tmp. > > Every individual test in elfutils involves a temporary directory. > Previous version of this script put that directory under the build > tree. That's OK if it's a local disk, but if it's on NFS, then some > tests - run-large-elf-file.sh, several run-debuginfod-*.sh - take long > enough to run to fail tests intermittently. > > This patch moves the temp_dir under ${TMPDIR-/var/tmp/}, so it > operates at local disk speed rather than whatever-build-filesystem > speed. Individual test scripts are all unaffected. (One could > consider /tmp instead, which is a RAM disk on modern systems, except > that some of the elfutils tests produce GB-sized temporary files. > That's probably too big for RAM.) I think ${TMPDIR-/var/tmp/} is the correct choice. /tmp is indeed supposed to only have small files. > Signed-off-by: Frank Ch. Eigler <fche@redhat.com> > --- > tests/test-subr.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/test-subr.sh b/tests/test-subr.sh > index 411e5f288acd..68ef541f8632 100644 > --- a/tests/test-subr.sh > +++ b/tests/test-subr.sh > @@ -23,7 +23,7 @@ > set -e > > # Each test runs in its own directory to make sure they can run in parallel. > -test_dir="test-$$" > +test_dir="${TMPDIR-/var/tmp}/test-$$" I would make this /test-elfutils-$$ then in case some files are left around someone can more easily see where they came from. > mkdir -p "$test_dir" > cd "$test_dir" There is one "tricky" cleanup issue slightly below this: # Tests that trap EXIT (0) themselves should call this explicitly. exit_cleanup() { rm -f $remove_files; cd ..; rmdir $test_dir } trap exit_cleanup 0 On clean exit we remove all (tempfiles) and then try to remove the $test_dir. Note that this fails (the test) if any non-tmp-file is left behind. I think this works, but the cd .. doesn't end up where it originally did. Maybe save the orig_dir="${PWD}" before creating the test_dir and cd $orig_dir here? Cheers, Mark
Hi - > I like the idea of this change. Some nitpicks below. Those were great ideas, v2 below: From 65efbafc16fffa582a84c277493d2531bf88021a Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" <fche@redhat.com> Date: Wed, 9 Oct 2024 13:41:14 -0400 Subject: [PATCH] tests/test-subr.sh: Put test_dir under /var/tmp. Every individual test in elfutils involves a temporary directory. Previous version of this script put that directory under the build tree. That's OK if it's a local disk, but if it's on NFS, then some tests - run-large-elf-file.sh, several run-debuginfod-*.sh - take long enough to run to fail tests intermittently. This patch moves the temp_dir under ${TMPDIR-/var/tmp/}, so it operates at local disk speed rather than whatever-build-filesystem speed. Individual test scripts are all unaffected. (One could consider /tmp instead, which is a RAM disk on modern systems, except that some of the elfutils tests produce GB-sized temporary files. That's probably too big for RAM.) Signed-off-by: Frank Ch. Eigler <fche@redhat.com> --- tests/test-subr.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test-subr.sh b/tests/test-subr.sh index 411e5f288acd..ea80cbec3bc7 100644 --- a/tests/test-subr.sh +++ b/tests/test-subr.sh @@ -23,8 +23,9 @@ set -e # Each test runs in its own directory to make sure they can run in parallel. -test_dir="test-$$" +test_dir="${TMPDIR-/var/tmp}/elfutils-test-$$" mkdir -p "$test_dir" +orig_dir="${PWD}" cd "$test_dir" #LC_ALL=C @@ -35,7 +36,7 @@ remove_files= # Tests that trap EXIT (0) themselves should call this explicitly. exit_cleanup() { - rm -f $remove_files; cd ..; rmdir $test_dir + rm -f $remove_files; cd $orig_dir; rmdir $test_dir } trap exit_cleanup 0
Hi Frank, On Wed, Oct 09, 2024 at 04:43:56PM -0400, Frank Ch. Eigler wrote: > > I like the idea of this change. Some nitpicks below. > > Those were great ideas, v2 below: > > From 65efbafc16fffa582a84c277493d2531bf88021a Mon Sep 17 00:00:00 2001 > From: "Frank Ch. Eigler" <fche@redhat.com> > Date: Wed, 9 Oct 2024 13:41:14 -0400 > Subject: [PATCH] tests/test-subr.sh: Put test_dir under /var/tmp. > > Every individual test in elfutils involves a temporary directory. > Previous version of this script put that directory under the build > tree. That's OK if it's a local disk, but if it's on NFS, then some > tests - run-large-elf-file.sh, several run-debuginfod-*.sh - take long > enough to run to fail tests intermittently. > > This patch moves the temp_dir under ${TMPDIR-/var/tmp/}, so it > operates at local disk speed rather than whatever-build-filesystem > speed. Individual test scripts are all unaffected. (One could > consider /tmp instead, which is a RAM disk on modern systems, except > that some of the elfutils tests produce GB-sized temporary files. > That's probably too big for RAM.) Looks good to me. Thanks, Mark
diff --git a/tests/test-subr.sh b/tests/test-subr.sh index 411e5f288acd..68ef541f8632 100644 --- a/tests/test-subr.sh +++ b/tests/test-subr.sh @@ -23,7 +23,7 @@ set -e # Each test runs in its own directory to make sure they can run in parallel. -test_dir="test-$$" +test_dir="${TMPDIR-/var/tmp}/test-$$" mkdir -p "$test_dir" cd "$test_dir"