summaryrefslogtreecommitdiff
path: root/libs/libmdbx/src/test
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-10-02 14:05:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-10-02 14:05:32 +0300
commite123b23e3176dfc83fd6d175d8b211cd83b37fcf (patch)
tree7b4bdefb59b0f2935bdd84e70c2515c1cdb31e82 /libs/libmdbx/src/test
parente80d4e54be3f7e0dffc940e63f48f2ea0bb1d3ca (diff)
minor fix for libmdbx
Diffstat (limited to 'libs/libmdbx/src/test')
-rw-r--r--libs/libmdbx/src/test/gc.sh32
-rw-r--r--libs/libmdbx/src/test/loop.bat15
-rw-r--r--libs/libmdbx/src/test/osal-windows.cc10
3 files changed, 25 insertions, 32 deletions
diff --git a/libs/libmdbx/src/test/gc.sh b/libs/libmdbx/src/test/gc.sh
index 0625518a4f..be6991a48f 100644
--- a/libs/libmdbx/src/test/gc.sh
+++ b/libs/libmdbx/src/test/gc.sh
@@ -23,45 +23,17 @@ function probe {
echo "=============================================== $(date)"
echo "${caption}: $*"
rm -f ${TESTDB_PREFIX}* \
- && ./mdbx_test --pathname=${TESTDB_PREFIX}db "$@" | lz4 > log.lz4 \
+ && ./mdbx_test --pathname=${TESTDB_PREFIX}db "$@" | lz4 > ${TESTDB_PREFIX}log.lz4 \
&& ./mdbx_chk -nvvv ${TESTDB_PREFIX}db | tee ${TESTDB_PREFIX}chk \
|| (echo "FAILED"; exit 1)
}
###############################################################################
-caption="Failfast #1" probe \
- --pagesize=min --size=6G --table=+data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
- --nops=99999 --batch.write=9 --mode=-writemap,-coalesce,+lifo --keygen.seed=248240655 basic
-
-caption="Failfast #2" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=999 --mode=+writemap,+coalesce,+lifo --keygen.seed=259083046 basic
-
-caption="Failfast #3" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=999 --mode=+writemap,+coalesce,+lifo --keygen.seed=522365681 basic
-
-caption="Failfast #4" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=9999 --mode=-writemap,+coalesce,+lifo --keygen.seed=866083781 basic
-
-caption="Failfast #5" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=999 --mode=+writemap,-coalesce,+lifo --keygen.seed=246539192 basic
-
-caption="Failfast #6" probe \
- --pagesize=min --size=6G --table=-data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
- --nops=999999 --batch.write=999 --mode=+writemap,+coalesce,+lifo --keygen.seed=540406278 basic
-
-caption="Failfast #7" probe \
- --pagesize=min --size=6G --table=+data.dups --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
- --nops=999999 --batch.write=999 --mode=-writemap,+coalesce,+lifo --keygen.seed=619798690 basic
-
count=0
for nops in {2..7}; do
for ((wbatch=nops-1; wbatch > 0; --wbatch)); do
- loops=$((1111/nops + 2))
+ loops=$(((3333 >> nops) / nops + 1))
for ((rep=0; rep++ < loops; )); do
for ((bits=2**${#options[@]}; --bits >= 0; )); do
seed=$(date +%N)
diff --git a/libs/libmdbx/src/test/loop.bat b/libs/libmdbx/src/test/loop.bat
new file mode 100644
index 0000000000..0e3b6271c9
--- /dev/null
+++ b/libs/libmdbx/src/test/loop.bat
@@ -0,0 +1,15 @@
+@echo off
+
+del test.db test.db-lck
+
+:loop
+
+mdbx_test.exe --pathname=test.db --dont-cleanup-after basic > test.log
+if errorlevel 1 goto fail
+
+mdbx_chk.exe -nvvv test.db > chk.log
+if errorlevel 1 goto fail
+goto loop
+
+:fail
+echo FAILED
diff --git a/libs/libmdbx/src/test/osal-windows.cc b/libs/libmdbx/src/test/osal-windows.cc
index 81f1da7f86..7d59f657c2 100644
--- a/libs/libmdbx/src/test/osal-windows.cc
+++ b/libs/libmdbx/src/test/osal-windows.cc
@@ -262,12 +262,18 @@ int osal_actor_start(const actor_config &config, mdbx_pid_t &pid) {
STARTUPINFOA StartupInfo;
GetStartupInfoA(&StartupInfo);
- char exename[_MAX_PATH];
+ char exename[_MAX_PATH + 1];
DWORD exename_size = sizeof(exename);
if (!QueryFullProcessImageNameA(GetCurrentProcess(), 0, exename,
&exename_size))
failure_perror("QueryFullProcessImageName()", GetLastError());
+ if (exename[1] != ':') {
+ exename_size = GetModuleFileName(NULL, exename, sizeof(exename));
+ if (exename_size >= sizeof(exename))
+ return ERROR_BAD_LENGTH;
+ }
+
std::string cmdline = "$ ";
ArgvQuote(cmdline, thunk_param(config));
@@ -283,7 +289,7 @@ int osal_actor_start(const actor_config &config, mdbx_pid_t &pid) {
NULL, // Inherit the parent's environment.
NULL, // Inherit the parent's current directory.
&StartupInfo, &ProcessInformation))
- return GetLastError();
+ failure_perror(exename, GetLastError());
CloseHandle(ProcessInformation.hThread);
pid = ProcessInformation.dwProcessId;