repen heartbeat ut (#27684)

my_2.0rc
tangwei12 5 years ago committed by GitHub
parent f373269df0
commit fd616fadc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,7 +84,7 @@ void HeartBeatMonitor::LostWorkerMonitor() {
} }
} }
std::this_thread::sleep_for(std::chrono::milliseconds(30 * 1000)); std::this_thread::sleep_for(std::chrono::milliseconds(10 * 1000));
} }
VLOG(1) << "worker heartbeat monitor stopped, thread exit"; VLOG(1) << "worker heartbeat monitor stopped, thread exit";
} }

@ -23,32 +23,30 @@ namespace distributed {
void run(HeartBeatMonitor* monitor) { monitor->LostWorkerMonitor(); } void run(HeartBeatMonitor* monitor) { monitor->LostWorkerMonitor(); }
TEST(HeartBeatMonitor, All) { TEST(HeartBeatMonitor, All) {
// (tangwei12) fix it soon. int trainers = 10;
return; int pserver_id = 0;
// int trainers = 10; std::string var = "nce_w@GRAD.block0";
// int pserver_id = 0; std::string var2 = "nce_w@GRAD.block2";
// std::string var = "nce_w@GRAD.block0";
// std::string var2 = "nce_w@GRAD.block2"; HeartBeatMonitor::Init(trainers, pserver_id == 0, var);
//
// HeartBeatMonitor::Init(trainers, pserver_id == 0, var); auto* monitor = HeartBeatMonitor::GetInstance();
//
// auto* monitor = HeartBeatMonitor::GetInstance(); std::vector<int> ids{1, 3, 5, 7};
//
// std::vector<int> ids{1, 3, 5, 7}; for (auto& id : ids) {
// monitor->Update(id, var, RUNNING);
// for (auto& id : ids) { }
// monitor->Update(id, var, RUNNING);
// } monitor->Update(9, var2, RUNNING);
// monitor->Update(2, var, COMPLETED);
// monitor->Update(9, var2, RUNNING);
// monitor->Update(2, var, COMPLETED); std::thread t(run, monitor);
// t.detach();
// std::thread t(run, monitor);
// t.detach(); std::this_thread::sleep_for(std::chrono::milliseconds(15 * 1000));
//
// std::this_thread::sleep_for(std::chrono::milliseconds(45 * 1000)); monitor->Stop();
//
// monitor->Stop();
} }
} // namespace distributed } // namespace distributed

Loading…
Cancel
Save