提交 964a757d 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1378 Just want to debug this case in Jenkin environment

Merge pull request !1378 from JesseKLee/cond_var_debug
......@@ -50,7 +50,7 @@ TEST_F(MindDataTestTaskManager, Test1) {
}
TEST_F(MindDataTestTaskManager, Test2) {
// This testcase will spawn about 10 threads and block on a conditional variable.
// This testcase will spawn about 100 threads and block on a conditional variable.
// The master thread will try to interrupt them almost at the same time. This can
// cause a racing condition that some threads may miss the interrupt and blocked.
// The new logic of Task::Join() will do a time-out join and wake up all those
......@@ -59,11 +59,11 @@ TEST_F(MindDataTestTaskManager, Test2) {
(void)TaskManager::GetMasterThreadRc();
TaskGroup vg;
CondVar cv;
std::mutex mux;
Status rc;
rc = cv.Register(vg.GetIntrpService());
EXPECT_TRUE(rc.IsOk());
auto block_forever = [&cv]() -> Status {
std::mutex mux;
auto block_forever = [&cv, &mux]() -> Status {
std::unique_lock<std::mutex> lck(mux);
TaskManager::FindMe()->Post();
std::this_thread::sleep_for(std::chrono::milliseconds(1));
......@@ -71,7 +71,7 @@ TEST_F(MindDataTestTaskManager, Test2) {
return Status::OK();
};
auto f = [&vg, &block_forever]() -> Status {
for (auto i = 0; i < 10; ++i) {
for (auto i = 0; i < 100; ++i) {
RETURN_IF_NOT_OK(vg.CreateAsyncTask("Spawn block threads", block_forever));
}
return Status::OK();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册