From 906e0c01d0515ccac802ead43465ae44802656c6 Mon Sep 17 00:00:00 2001 From: SolenoidWGT <877825076@qq.com> Date: Fri, 13 Jan 2023 05:20:06 +0000 Subject: [PATCH] Modify codecov concurrency mode from threading to multiprocessing --- .coveragerc | 1 + ding/framework/middleware/tests/test_barrier.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.coveragerc b/.coveragerc index 071b61b24d..d9174acf52 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,5 @@ [run] +concurrency = multiprocessing,thread omit = ding/utils/slurm_helper.py ding/utils/file_helper.py diff --git a/ding/framework/middleware/tests/test_barrier.py b/ding/framework/middleware/tests/test_barrier.py index 51efa4e080..de176eda2d 100644 --- a/ding/framework/middleware/tests/test_barrier.py +++ b/ding/framework/middleware/tests/test_barrier.py @@ -122,6 +122,8 @@ def test_star_topology_barrier(): ctx = mp.get_context("spawn") with ctx.Pool(processes=4) as pool: pool.map(launch_barrier, [[i, 'star', star_barrier, 0] for i in range(4)]) + pool.close() + pool.join() @pytest.mark.unittest @@ -129,6 +131,8 @@ def test_mesh_topology_barrier(): ctx = mp.get_context("spawn") with ctx.Pool(processes=4) as pool: pool.map(launch_barrier, [[i, 'mesh', mesh_barrier, 1] for i in range(4)]) + pool.close() + pool.join() @pytest.mark.unittest @@ -136,3 +140,5 @@ def test_unmatch_barrier(): ctx = mp.get_context("spawn") with ctx.Pool(processes=4) as pool: pool.map(launch_barrier, [[i, 'mesh', unmatch_barrier, 2] for i in range(4)]) + pool.close() + pool.join()