From 6d6a19e3c3f9d2b8b13324ca798b623e6a28b0fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Fri, 18 Apr 2025 13:02:14 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-tests:=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=20salt/seed=20=D0=B2=20extra/cursor-closing.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/extra/cursor_closing.c++ | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/extra/cursor_closing.c++ b/test/extra/cursor_closing.c++ index 2a0184a6..5cfbc09b 100644 --- a/test/extra/cursor_closing.c++ +++ b/test/extra/cursor_closing.c++ @@ -107,6 +107,7 @@ bool case0(mdbx::env env) { * 4. Ждем завершения фоновых потоков. * 5. Закрываем оставшиеся курсоры и закрываем БД. */ +size_t global_seed = size_t(std::chrono::high_resolution_clock::now().time_since_epoch().count()); thread_local size_t salt; static size_t prng() { @@ -284,7 +285,12 @@ void case1_write_cycle(mdbx::txn_managed txn, std::deque &dbi, } bool case1_thread(mdbx::env env, std::deque dbi, mdbx::cursor pre) { - salt = size_t(std::chrono::high_resolution_clock::now().time_since_epoch().count()); + mdbx::error::success_or_throw(mdbx_txn_lock(env, false)); + std::hash hasher; + salt = global_seed ^ hasher(std::this_thread::get_id()); + std::cout << "thread " << std::this_thread::get_id() << ", salt " << salt << std::endl << std::flush; + mdbx_txn_unlock(env); + std::vector pool; for (auto loop = 0; loop < 333 / RELIEF_FACTOR; ++loop) { for (auto read = 0; read < 333 / RELIEF_FACTOR; ++read) {