All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: zlang@redhat.com, djwong@kernel.org
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 1/2] generic/038: set a maximum runtime on this test
Date: Tue, 31 Jan 2023 16:51:35 -0800	[thread overview]
Message-ID: <167521269515.2382722.13790661033478617605.stgit@magnolia> (raw)
In-Reply-To: <167521268927.2382722.13701066927653225895.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

This test races multiple FITRIM calls against multiple programs creating
200k small files to ensure that there are no concurrency problems with
the allocator and the FITRIM code.  This is not necessarily quick, and
the test itself does not contain any upper bound on the runtime.  On my
system that simulates storage with DRAM this takes ~5 minutes to run; on
my cloud system with newly provided discard support, I killed the test
after 27 hours.

Constrain the runtime to about the customary 30s * TIME_FACTOR.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/038 |    6 ++++++
 1 file changed, 6 insertions(+)


diff --git a/tests/generic/038 b/tests/generic/038
index 5c014ae389..e1176292fb 100755
--- a/tests/generic/038
+++ b/tests/generic/038
@@ -100,6 +100,8 @@ nr_files=$((50000 * LOAD_FACTOR))
 create_files()
 {
 	local prefix=$1
+	local now=$(date '+%s')
+	local end_time=$(( now + (TIME_FACTOR * 30) ))
 
 	for ((n = 0; n < 4; n++)); do
 		mkdir $SCRATCH_MNT/$n
@@ -113,6 +115,10 @@ create_files()
 				echo "Failed creating file $n/${prefix}_$i" >>$seqres.full
 				break
 			fi
+			if [ "$(date '+%s')" -ge $end_time ]; then
+				echo "runtime exceeded @ $i files" >> $seqres.full
+				break
+			fi
 		done
 		) &
 		create_pids[$n]=$!


  reply	other threads:[~2023-02-01  0:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01  0:51 [PATCHSET 0/2] fstests: random fixes for v2023.01.22 Darrick J. Wong
2023-02-01  0:51 ` Darrick J. Wong [this message]
2023-02-02  9:53   ` [PATCH 1/2] generic/038: set a maximum runtime on this test Zorro Lang
2023-02-01  0:51 ` [PATCH 2/2] generic/500: skip this test if formatting fails Darrick J. Wong
2023-02-02 10:00   ` Zorro Lang
2023-02-02 17:04     ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=167521269515.2382722.13790661033478617605.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.