From 2cc939bbfae9189fc3c761563ab3660854f011d1 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Tue, 30 Oct 2018 21:02:26 +0800 Subject: [PATCH] Fix Mac Python3 CI job test=develop --- python/paddle/fluid/tests/unittests/CMakeLists.txt | 1 + python/paddle/fluid/tests/unittests/test_dist_base.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index cf54bc2dbe7..01fe3b27bfb 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -17,6 +17,7 @@ if(NOT WITH_DISTRIBUTE) list(REMOVE_ITEM TEST_OPS test_listen_and_serv_op) LIST(REMOVE_ITEM TEST_OPS test_dist_mnist) LIST(REMOVE_ITEM TEST_OPS test_dist_word2vec) + LIST(REMOVE_ITEM TEST_OPS test_dist_ctr) endif(NOT WITH_DISTRIBUTE) list(REMOVE_ITEM TEST_OPS test_seq_concat_op) # FIXME(helin): https://github.com/PaddlePaddle/Paddle/issues/8290 diff --git a/python/paddle/fluid/tests/unittests/test_dist_base.py b/python/paddle/fluid/tests/unittests/test_dist_base.py index 87fd03ca61d..a669111f306 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_base.py +++ b/python/paddle/fluid/tests/unittests/test_dist_base.py @@ -188,7 +188,7 @@ class TestDistBase(unittest.TestCase): self._pservers = 2 self._ps_endpoints = "127.0.0.1:%s,127.0.0.1:%s" % ( self._find_free_port(), self._find_free_port()) - self._python_interp = "python" + self._python_interp = sys.executable self._sync_mode = True self._enforce_place = None self._mem_opt = False @@ -221,8 +221,12 @@ class TestDistBase(unittest.TestCase): print(ps0_cmd) print(ps1_cmd) - ps0_pipe = open("/tmp/ps0_err.log", "wb") - ps1_pipe = open("/tmp/ps1_err.log", "wb") + if check_error_log: + ps0_pipe = open("/tmp/ps0_err.log", "wb") + ps1_pipe = open("/tmp/ps1_err.log", "wb") + else: + ps0_pipe = subprocess.PIPE + ps1_pipe = subprocess.PIPE ps0_proc = subprocess.Popen( ps0_cmd.strip().split(" "), -- GitLab