mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Fix bad sleep
This commit is contained in:
parent
e80b93939f
commit
a207e3db75
@ -9,6 +9,7 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -191,7 +192,8 @@ void createPathAndSetWatch(zkutil::ZooKeeper & zk, const String & path_prefix, s
|
|||||||
std::lock_guard lock(elements_mutex);
|
std::lock_guard lock(elements_mutex);
|
||||||
current_elements.push_back(element);
|
current_elements.push_back(element);
|
||||||
}
|
}
|
||||||
sleep(0.2);
|
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard lock(elements_mutex);
|
std::lock_guard lock(elements_mutex);
|
||||||
@ -227,7 +229,7 @@ void tryConcurrentWatches(zkutil::ZooKeeper & zk)
|
|||||||
size_t counter = 0;
|
size_t counter = 0;
|
||||||
while (watches_triggered != 100 * 100)
|
while (watches_triggered != 100 * 100)
|
||||||
{
|
{
|
||||||
sleep(0.1);
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
if (counter++ > 20)
|
if (counter++ > 20)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user