Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#1209 from reyoung/feature/fix_destroy…
Browse files Browse the repository at this point in the history
…_error

Fix destroy error in test_ProtoServer.
  • Loading branch information
reyoung authored Jan 24, 2017
2 parents 1ecfc2d + 23c8ad8 commit b1f09f2
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions paddle/pserver/test/test_ProtoServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
limitations under the License. */

#include "paddle/utils/Util.h"

#include <gtest/gtest.h>

#include <memory>
#include "ParameterService.pb.h"
#include "paddle/math/Vector.h"
#include "paddle/pserver/ProtoServer.h"
#include "paddle/utils/Stat.h"
#include "paddle/utils/Util.h"

DEFINE_string(server_addr, "127.0.0.1", "Server address");
DEFINE_int64(dim, 50000000, "Data size");
Expand Down Expand Up @@ -162,18 +161,9 @@ TEST(ProtoServer, extended) {
int main(int argc, char** argv) {
paddle::initMain(argc, argv);
testing::InitGoogleTest(&argc, argv);

MyServer* server;
if (FLAGS_rdma_tcp == "rdma") {
server = new MyServer(FLAGS_port, 0);
} else {
server = new MyServer(FLAGS_port);
}

server->start();
MyServer server(FLAGS_port, FLAGS_rdma_tcp == "rdma" ? 0 : -1);
server.start();
usleep(10000);

int ret = RUN_ALL_TESTS();

exit(ret);
return RUN_ALL_TESTS();
}

0 comments on commit b1f09f2

Please sign in to comment.