Skip to content

Commit

Permalink
Fix data race in gtest_rate_limiter.cpp (#4421)
Browse files Browse the repository at this point in the history
close #4420
  • Loading branch information
JinheLin authored Mar 24, 2022
1 parent a671d6b commit 801e26b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dbms/src/Encryption/tests/gtest_rate_limiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::thread::id>()(std::this_thread::get_id()));
AtomicStopwatch watch;
while (watch.elapsedSeconds() < 4)
{
Expand Down

0 comments on commit 801e26b

Please sign in to comment.