From: Andreas Dilger <adilger@dilger.ca>
To: tytso@mit.edu
Cc: linux-ext4@vger.kernel.org, Andreas Dilger <adilger@dilger.ca>
Subject: [PATCH] tests: report if a test is taking a long time
Date: Fri, 25 Aug 2017 23:19:48 -0600 [thread overview]
Message-ID: <1503724788-84776-1-git-send-email-adilger@dilger.ca> (raw)
Print out a message if a test takes longer than 60s, with a
reminder to potentially add is_slow_test to that test, so
that it is easier to find which tests are taking a long time,
especially if running with "make -j check" or similar.
Add an exclusion for r_expand_full on MacOS since HFS+ does
not support sparse devices and doesn't like large test images.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
---
tests/r_expand_full/script | 6 ++++++
tests/test_one.in | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/tests/r_expand_full/script b/tests/r_expand_full/script
index a2c09db..2fd4461 100644
--- a/tests/r_expand_full/script
+++ b/tests/r_expand_full/script
@@ -23,6 +23,12 @@ cat > $CONF << ENDL
}
ENDL
+if [ $(uname -s) = "Darwin" ]; then
+ # creates a 786MB filesystem
+ echo "$test_name: $DESCRIPTION: skipped for HFS+ (no sparse files)"
+ return 0
+fi
+
echo "resize2fs test" > $OUT
MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h $TMPFILE 786432 >> $OUT 2>&1
diff --git a/tests/test_one.in b/tests/test_one.in
index 35465b6..d046380 100644
--- a/tests/test_one.in
+++ b/tests/test_one.in
@@ -61,6 +61,7 @@ fi
rm -f $test_name.ok $test_name.failed
#echo -e -n "$test_name: $test_description:\r"
+start=$SECONDS
if [ -f $test_dir/script ]; then
. $test_dir/script
else
@@ -72,6 +73,11 @@ else
echo "$test_name: Missing test script $default_script!"
fi
fi
+elapsed=$((SECONDS - start))
+if [ $elapsed -gt 60 -a ! -f $test_dir/is_slow_test ]; then
+ echo "$test_name: *** took $elapsed seconds to finish ***"
+ echo "$test_name: consider adding $test_dir/is_slow_test"
+fi
if [ "$SKIP_UNLINK" != "true" ] ; then
rm -f $TMPFILE
--
1.8.0
next reply other threads:[~2017-08-26 5:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-26 5:19 Andreas Dilger [this message]
2017-08-30 6:07 ` tests: report if a test is taking a long time Theodore Ts'o
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=1503724788-84776-1-git-send-email-adilger@dilger.ca \
--to=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).