Browse Source

!198 fix ut bug

From: @qinzheng4
Reviewed-by: @xu-yfei,@zhangyinxia,@xu-yfei
Signed-off-by: @xu-yfei,@xu-yfei
tags/v1.2.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
6c5d08c6bb
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      tests/ut/cpp/tests/test_distributed_inference.cc

+ 5
- 3
tests/ut/cpp/tests/test_distributed_inference.cc View File

@@ -52,10 +52,12 @@ class FakeNotifyAgent : public BaseNotifyAgent {
error_msg->set_error_msg(error_msg_);
}

auto predict = [=]() {
std::chrono::milliseconds dura(prediction_time_);
auto prediction_time = prediction_time_;
auto status = status_;
auto predict = [prediction_time, status, callback]() {
std::chrono::milliseconds dura(prediction_time);
std::this_thread::sleep_for(dura);
callback(status_);
callback(status);
};
std::thread t1(predict);
t1.detach();


Loading…
Cancel
Save