From de4a6baf808ba902252ccaa30273505654629a4e Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 12 Jul 2021 10:53:12 +0300 Subject: [PATCH] mdbx-test: add `--db-upto-mb` option for stochastic script. --- test/long_stochastic.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/long_stochastic.sh b/test/long_stochastic.sh index d755d85d..157c052e 100755 --- a/test/long_stochastic.sh +++ b/test/long_stochastic.sh @@ -12,6 +12,7 @@ LOOPS= SKIP_MAKE=no BANNER="$(which banner 2>/dev/null | echo echo)" UNAME="$(uname -s 2>/dev/null || echo Unknown)" +DB_UPTO_MB=17408 while [ -n "$1" ] do @@ -25,6 +26,7 @@ do echo "--upto NN" echo "--loops NN" echo "--dir PATH" + echo "--db-upto-mb NN" ;; --multi) LIST=basic @@ -76,6 +78,14 @@ do fi shift ;; + --db-upto-mb) + DB_UPTO_MB="$2" + if [ -z "$DB_UPTO_MB" -o "$DB_UPTO_MB" -lt 1 -o "$DB_UPTO_MB" -gt 4194304 ]; then + echo "Invalid value '$DB_UPTO_MB' for --db-upto-mb option" + exit -2 + fi + shift + ;; *) echo "Unknown option '$1'" exit -2 @@ -189,8 +199,8 @@ fi # system immediately, as well some space is required for logs. # db_size_mb=$(((ram_avail_mb - ram_reserve4logs_mb) / 4)) -if [ $db_size_mb -gt 17408 ]; then - db_size_mb=17408 +if [ $db_size_mb -gt $DB_UPTO_MB ]; then + db_size_mb=$DB_UPTO_MB fi echo "=== use ${db_size_mb}M for DB"