提交 fae5d82c 编写于 作者: Y Yu Yang

Fix destroy error in test_ProtoServer.

上级 ad4c62f3
3 合并请求!11636[IMPORTANT] MKLDNN layout: Support for sum operator,!2081Release/0.10.0,!1209Fix destroy error in test_ProtoServer.
...@@ -12,14 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,14 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "paddle/utils/Util.h"
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <memory>
#include "ParameterService.pb.h" #include "ParameterService.pb.h"
#include "paddle/math/Vector.h" #include "paddle/math/Vector.h"
#include "paddle/pserver/ProtoServer.h" #include "paddle/pserver/ProtoServer.h"
#include "paddle/utils/Stat.h" #include "paddle/utils/Stat.h"
#include "paddle/utils/Util.h"
DEFINE_string(server_addr, "127.0.0.1", "Server address"); DEFINE_string(server_addr, "127.0.0.1", "Server address");
DEFINE_int64(dim, 50000000, "Data size"); DEFINE_int64(dim, 50000000, "Data size");
...@@ -163,17 +162,15 @@ int main(int argc, char** argv) { ...@@ -163,17 +162,15 @@ int main(int argc, char** argv) {
paddle::initMain(argc, argv); paddle::initMain(argc, argv);
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
MyServer* server; std::unique_ptr<MyServer> server;
if (FLAGS_rdma_tcp == "rdma") { if (FLAGS_rdma_tcp == "rdma") {
server = new MyServer(FLAGS_port, 0); server.reset(new MyServer(FLAGS_port, 0));
} else { } else {
server = new MyServer(FLAGS_port); server.reset(new MyServer(FLAGS_port));
} }
server->start(); server->start();
usleep(10000); usleep(10000);
int ret = RUN_ALL_TESTS(); return RUN_ALL_TESTS();
exit(ret);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部