diff --git a/test/battery-tmux.sh b/test/battery-tmux.sh new file mode 100755 index 00000000..3fae3fc8 --- /dev/null +++ b/test/battery-tmux.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Леонид Юрьев aka Leonid Yuriev +# SPDX-License-Identifier: Apache-2.0 + +TEST="./test/long_stochastic.sh --skip-make" +PREFIX="/dev/shm/mdbxtest-" + +tmux kill-session -t mdbx +rm -rf ${PREFIX}* +# git clean -x -f -d && make test-assertions +tmux -f ./test/tmux.conf new-session -d -s mdbx htop + +W=0 +for ps in min 4k max; do + for from in 1 30000; do + for n in 0 1 2 3 4 5 6 7; do + CMD="${TEST} --delay $((n * 7)) --page-size ${ps} --from ${from} --dir ${PREFIX}page-${ps}.from-${from}.${n}" + if [ $n -eq 0 ]; then + tmux new-window -t mdbx:$((++W)) -n "page-${ps}.from-${from}" -k -d "$CMD" + tmux select-layout -E tiled + else + tmux split-window -t mdbx:$W -l 20% -d $CMD + fi + done + for n in 0 1 2 3 4 5 6 7; do + CMD="${TEST} --delay $((3 + n * 7)) --page-size ${ps} --from ${from} --dir ${PREFIX}page-${ps}.from-${from}.${n}-extra" + if [ $n -eq 0 ]; then + tmux new-window -t mdbx:$((++W)) -n "page-${ps}.from-${from}-extra" -k -d "$CMD" + tmux select-layout -E tiled + else + tmux split-window -t mdbx:$W -l 20% -d $CMD + fi + done + done +done + +tmux attach -t mdbx diff --git a/test/long_stochastic.sh b/test/long_stochastic.sh index d3e30763..d761d73e 100755 --- a/test/long_stochastic.sh +++ b/test/long_stochastic.sh @@ -17,6 +17,7 @@ PAGESIZE=min DONT_CHECK_RAM=no EXTRA=no TAILLOG=0 +DELAY=0 while [ -n "$1" ] do @@ -40,6 +41,7 @@ do echo "--dont-check-ram-size Don't check available RAM" echo "--extra Iterate extra modes/flags" echo "--taillog Dump tail of test log on failure" + echo "--delay NN Delay NN seconds before run test" echo "--help Print this usage help and exit" exit -2 ;; @@ -158,6 +160,10 @@ do --extra) EXTRA=yes ;; + --delay) + DELAY=$(($2)) + shift + ;; *) echo "Unknown option '$1'" exit -2 @@ -437,6 +443,10 @@ function probe { #------------------------------------------------------------------------------ +if [ "$DELAY" != "0" ]; then + sleep $DELAY +fi + count=0 loop=0 cases='?' diff --git a/test/tmux.conf b/test/tmux.conf new file mode 100644 index 00000000..49a78caa --- /dev/null +++ b/test/tmux.conf @@ -0,0 +1,3 @@ +setw -g aggressive-resize on +set-option -g remain-on-exit on +# set-option -g remain-on-exit-format FAILED