aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Holm <pho@FreeBSD.org>2024-08-30 08:04:46 +0000
committerPeter Holm <pho@FreeBSD.org>2024-08-30 08:04:46 +0000
commitf6fd5af80a37ef0560959bd55c2c86d17ee2033f (patch)
treef168367748bda9374069baa57ce856285e7637eb
parent6e25bccb989c3fdea550833484f262d47910a249 (diff)
downloadsrc-f6fd5af80a37ef0560959bd55c2c86d17ee2033f.tar.gz
src-f6fd5af80a37ef0560959bd55c2c86d17ee2033f.zip
stress2: Do not wait forever for swap usage
-rwxr-xr-xtools/test/stress2/misc/mmap40.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/test/stress2/misc/mmap40.sh b/tools/test/stress2/misc/mmap40.sh
index 7f4d07885e05..2314596e2f5d 100755
--- a/tools/test/stress2/misc/mmap40.sh
+++ b/tools/test/stress2/misc/mmap40.sh
@@ -53,13 +53,14 @@ mount /dev/md$mdstart $mntpoint
set +e
u1=`swapinfo | tail -1 | awk '{print $3}'`
-(nice $odir/../testcases/swap/swap -t 10m -i 30 -h -l 100) &
-while [ $((`swapinfo | tail -1 | awk '{print $3}'` - $u1)) -le 100 ]; do
+(nice $odir/../testcases/swap/swap -t 10m -i 30 -h -l 100) > /dev/null &
+for i in `jot 120`; do
+ u2=`swapinfo | tail -1 | awk '{print $3}'`
+ [ $u2 -lt $u1 ] && u1=$u2
+ [ $((u2 - $u1)) -gt 100 ] && break
sleep 1
done
-
-$dir/mmap40
-s=0
+/usr/bin/timeout 10m $dir/mmap40; s=$?
while pkill swap; do :; done
wait
[ -f mmap40.core -a $s -eq 0 ] &&