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: guan@eryu.me, linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 01/10] generic/256: constrain runtime with TIME_FACTOR
Date: Thu, 25 Jan 2024 11:04:14 -0800	[thread overview]
Message-ID: <170620924382.3283496.6995781268514337077.stgit@frogsfrogsfrogs> (raw)
In-Reply-To: <170620924356.3283496.1996184171093691313.stgit@frogsfrogsfrogs>

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

This test runs 500 iterations of a "fill the fs and try to punch" test.
Hole punching can be particularly slow if, say, the filesystem is
mounted with -odiscard and the DISCARD operation takes a very long time.
In extreme cases, I can see test runtimes of 4+ hours.

Constrain the runtime of _test_full_fs_punch by establishing a deadline
of (30 seconds * TIME_FACTOR) and breaking out of the for loop if the
test goes beyond the time budget.  This keeps the runtime within the
customary 30 seconds.

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


diff --git a/tests/generic/256 b/tests/generic/256
index 808a730f3a..ea6cc2938a 100755
--- a/tests/generic/256
+++ b/tests/generic/256
@@ -44,6 +44,8 @@ _test_full_fs_punch()
 	local file_len=$(( $(( $hole_len + $hole_interval )) * $iterations ))
 	local path=`dirname $file_name`
 	local hole_offset=0
+	local start_time
+	local stop_time
 
 	if [ $# -ne 5 ]
 	then
@@ -57,6 +59,9 @@ _test_full_fs_punch()
 		-c "fsync" $file_name &> /dev/null
 	chmod 666 $file_name
 
+	start_time="$(date +%s)"
+	stop_time=$(( start_time + (30 * TIME_FACTOR) ))
+
 	# All files are created as a non root user to prevent reserved blocks
 	# from being consumed.
 	_fill_fs $(( 1024 * 1024 * 1024 )) $path/fill $block_size 1 \
@@ -64,6 +69,8 @@ _test_full_fs_punch()
 
 	for (( i=0; i<$iterations; i++ ))
 	do
+		test "$(date +%s)" -ge "$stop_time" && break
+
 		# This part must not be done as root in order to
 		# test that reserved blocks are used when needed
 		_user_do "$XFS_IO_PROG -f -c \"fpunch $hole_offset $hole_len\" $file_name"


  reply	other threads:[~2024-01-25 19:04 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 19:04 [PATCHSET] fstests: random fixes for v2024.01.14 Darrick J. Wong
2024-01-25 19:04 ` Darrick J. Wong [this message]
2024-01-26 12:32   ` [PATCH 01/10] generic/256: constrain runtime with TIME_FACTOR Andrey Albershteyn
2024-01-26 13:30   ` Christoph Hellwig
2024-01-25 19:04 ` [PATCH 02/10] common/xfs: simplify maximum metadump format detection Darrick J. Wong
2024-01-26 13:31   ` Christoph Hellwig
2024-01-25 19:04 ` [PATCH 03/10] common/populate: always metadump full metadata blocks Darrick J. Wong
2024-01-26 13:32   ` Christoph Hellwig
2024-01-25 19:05 ` [PATCH 04/10] xfs/336: fix omitted -a and -o in metadump call Darrick J. Wong
2024-01-26 13:33   ` Christoph Hellwig
2024-01-25 19:05 ` [PATCH 05/10] common: refactor metadump v1 and v2 tests Darrick J. Wong
2024-01-26 13:34   ` Christoph Hellwig
2024-01-27  8:47   ` Zorro Lang
2024-01-27 17:22     ` Darrick J. Wong
2024-01-28 13:23       ` Zorro Lang
2024-01-30  1:32         ` Darrick J. Wong
2024-01-31 14:09           ` Zorro Lang
2024-01-31 19:24             ` Darrick J. Wong
2024-02-01  6:29               ` Zorro Lang
2024-02-02 16:47                 ` Darrick J. Wong
2024-02-04  6:59                   ` Zorro Lang
2024-02-04  7:14                     ` Zorro Lang
2024-02-05  9:37   ` Zorro Lang
2024-02-05 16:48     ` Darrick J. Wong
2024-01-25 19:05 ` [PATCH 06/10] xfs/{129,234,253,605}: disable metadump v1 testing with external devices Darrick J. Wong
2024-01-26 13:34   ` Christoph Hellwig
2024-01-25 19:05 ` [PATCH 07/10] xfs/503: test metadump obfuscation, not progressbars Darrick J. Wong
2024-01-26 13:35   ` Christoph Hellwig
2024-01-25 19:06 ` [PATCH 08/10] xfs/503: split copy and metadump into two tests Darrick J. Wong
2024-01-26 13:36   ` Christoph Hellwig
2024-01-26 16:45     ` Darrick J. Wong
2024-01-25 19:06 ` [PATCH 09/10] common/xfs: only pass -l in _xfs_mdrestore for v2 metadumps Darrick J. Wong
2024-01-26 13:36   ` Christoph Hellwig
2024-01-25 19:06 ` [PATCH 10/10] xfs/122: fix for xfs_attr_shortform removal in 6.8 Darrick J. Wong
2024-01-26 12:38   ` Andrey Albershteyn
2024-01-26 13:37   ` Christoph Hellwig
2024-02-07  2:18 [PATCHSET] fstests: random fixes for v2024.01.14 Darrick J. Wong
2024-02-07  2:18 ` [PATCH 01/10] generic/256: constrain runtime with TIME_FACTOR 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=170620924382.3283496.6995781268514337077.stgit@frogsfrogsfrogs \
    --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.