git: 7b83aad3ffab - main - stress2: Exclude the files in .git. Simplify test by using timeout(1)

From: Peter Holm <pho_at_FreeBSD.org>
Date: Tue, 09 Nov 2021 08:30:11 UTC
The branch main has been updated by pho:

URL: https://cgit.FreeBSD.org/src/commit/?id=7b83aad3ffabe00ca68e4b2ae76294d39b853d00

commit 7b83aad3ffabe00ca68e4b2ae76294d39b853d00
Author:     Peter Holm <pho@FreeBSD.org>
AuthorDate: 2021-11-09 08:28:12 +0000
Commit:     Peter Holm <pho@FreeBSD.org>
CommitDate: 2021-11-09 08:28:12 +0000

    stress2: Exclude the files in .git.  Simplify test by using timeout(1)
---
 tools/test/stress2/misc/gnop4.sh | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh
index 2e4cc1a5df35..f938dd3b790b 100755
--- a/tools/test/stress2/misc/gnop4.sh
+++ b/tools/test/stress2/misc/gnop4.sh
@@ -55,19 +55,16 @@ mount /dev/md$mdstart.nop $mntpoint
 chmod 777 $mntpoint
 set +e
 
-start=`date '+%s'`
-(cd /usr; tar --exclude compile -cf - src) | (cd $mntpoint; tar xf -)
+(cd /usr; tar --exclude compile --exclude-vcs -cf - src) | \
+    (cd $mntpoint; tar xf -)
 
 cd $mntpoint/src
 export MAKEOBJDIRPREFIX=$mntpoint/obj
 
 p=$((`sysctl -n hw.ncpu`+ 1))
-make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 \
-    > /dev/null &
-e=$((`date '+%s'` - start))
-sleep $((15 *  60 - e))
-kill $!
-wait
+timeout 10m \
+    make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64 \
+    TARGET_ARCH=amd64 > /dev/null
 
 cd /
 while mount | grep $mntpoint | grep -q /dev/md; do