Merge pull request #167 from versity/auke/test-zero-time-createmany-parallel-mounts

Avoid math issues on fast test machines.
This commit is contained in:
Zach Brown
2024-07-22 10:12:09 -07:00
committed by GitHub

View File

@@ -2,7 +2,7 @@
# Test clustered parallel createmany # Test clustered parallel createmany
# #
t_require_commands mkdir createmany t_require_commands mkdir createmany bc
t_require_mounts 2 t_require_mounts 2
COUNT=50000 COUNT=50000
@@ -17,14 +17,14 @@ mkdir -p $T_D0/dir/0
mkdir $T_D1/dir/1 mkdir $T_D1/dir/1
echo "== measure initial createmany" echo "== measure initial createmany"
START=$SECONDS START=$(date +%s.%N)
createmany -o "$T_D0/file_" $COUNT >> $T_TMP.full createmany -o "$T_D0/file_" $COUNT >> $T_TMP.full
sync sync
SINGLE=$((SECONDS - START)) END=$(date +%s.%N)
echo single $SINGLE >> $T_TMP.full SINGLE=$(echo "$END - $START" | bc)
echo "== measure two concurrent createmany runs" echo "== measure two concurrent createmany runs"
START=$SECONDS START=$(date +%s.%N)
(cd $T_D0/dir/0; createmany -o ./file_ $COUNT > /dev/null) & (cd $T_D0/dir/0; createmany -o ./file_ $COUNT > /dev/null) &
pids="$!" pids="$!"
(cd $T_D1/dir/1; createmany -o ./file_ $COUNT > /dev/null) & (cd $T_D1/dir/1; createmany -o ./file_ $COUNT > /dev/null) &
@@ -33,7 +33,9 @@ for p in $pids; do
wait $p wait $p
done done
sync sync
BOTH=$((SECONDS - START)) END=$(date +%s.%N)
BOTH=$(echo "$END - $START" | bc)
echo both $BOTH >> $T_TMP.full echo both $BOTH >> $T_TMP.full
# Multi node still adds significant overhead, even with our CW locks # Multi node still adds significant overhead, even with our CW locks
@@ -44,7 +46,7 @@ echo both $BOTH >> $T_TMP.full
# exceed this factor should the CW locked items go back to fully # exceed this factor should the CW locked items go back to fully
# synchronized operation. # synchronized operation.
FACTOR=200 FACTOR=200
if [ "$BOTH" -gt $(($SINGLE*$FACTOR)) ]; then if [ $(echo "$BOTH > ( $SINGLE * $FACTOR )" | bc) == "1" ]; then
t_fail "both createmany took $BOTH sec, more than $FACTOR x single $SINGLE sec" t_fail "both createmany took $BOTH sec, more than $FACTOR x single $SINGLE sec"
fi fi