From e1d1de49cccaad1e7f30093ea1dbb2e1257c7f8e Mon Sep 17 00:00:00 2001 From: jinhelin Date: Mon, 21 Mar 2022 14:26:28 +0800 Subject: [PATCH] Fix ThreadSanitizer in test. --- dbms/src/Encryption/tests/gtest_rate_limiter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/Encryption/tests/gtest_rate_limiter.cpp b/dbms/src/Encryption/tests/gtest_rate_limiter.cpp index 730985d89de..51984b86460 100644 --- a/dbms/src/Encryption/tests/gtest_rate_limiter.cpp +++ b/dbms/src/Encryption/tests/gtest_rate_limiter.cpp @@ -39,9 +39,9 @@ namespace tests { TEST(WriteLimiterTest, Rate) { - std::default_random_engine e; - e.seed(time(nullptr)); - auto write = [&e](const WriteLimiterPtr & write_limiter, UInt64 max_request_size) { + auto write = [](const WriteLimiterPtr & write_limiter, UInt64 max_request_size) { + std::default_random_engine e; + e.seed(std::hash()(std::this_thread::get_id())); AtomicStopwatch watch; while (watch.elapsedSeconds() < 4) {