From 66ad68ed7bcfa803c98ef7ac83de2fb8b9f71065 Mon Sep 17 00:00:00 2001 From: hutuxian Date: Tue, 3 Sep 2019 15:34:12 +0800 Subject: [PATCH] Update UT test_boxps (#19599) Disable test_boxps in win32. Adjust filename to avoid latent multi-thread problem. --- python/paddle/fluid/tests/unittests/CMakeLists.txt | 4 ++++ python/paddle/fluid/tests/unittests/test_boxps.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index d656c12d8f8..838f0277aed 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -35,6 +35,10 @@ if(NOT WITH_GPU OR WIN32) LIST(REMOVE_ITEM TEST_OPS test_reducescatter) endif() +if(WIN32) + LIST(REMOVE_ITEM TEST_OPS test_boxps) +endif() + LIST(REMOVE_ITEM TEST_OPS test_launch) if (NOT ${WITH_GPU}) diff --git a/python/paddle/fluid/tests/unittests/test_boxps.py b/python/paddle/fluid/tests/unittests/test_boxps.py index 6a068d00776..0b07f965dd8 100644 --- a/python/paddle/fluid/tests/unittests/test_boxps.py +++ b/python/paddle/fluid/tests/unittests/test_boxps.py @@ -58,8 +58,9 @@ class TestBoxPSPreload(unittest.TestCase): batch1 = np.ones( (batch_size, 2, 1)).astype("int64").reshape(batch_size, 2, 1) filelist = [] + place_str = "cpu" if is_cpu else "gpu" for i in range(2): - filelist.append("test_hdfs_" + str(i)) + filelist.append("test_hdfs_" + place_str + "_" + str(i)) for f in filelist: with open(f, "w") as fout: for ins in batch1: -- GitLab