Skip to content

Commit a7a57a6

Browse files
committed
add multiprocess codecov support
1 parent c5119f5 commit a7a57a6

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[run]
2+
concurrency = multiprocessing
23
omit =
34
ding/utils/slurm_helper.py
45
ding/utils/file_helper.py

ding/framework/message_queue/perfs/tests/test_perf_nng.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ def test_nng():
1212
ctx = mp.get_context("spawn")
1313
with ctx.Pool(processes=2) as pool:
1414
pool.starmap(nng_perf_main, params)
15+
pool.close()
16+
pool.join()

ding/framework/message_queue/perfs/tests/test_perf_torchrpc_nccl.py

+2
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ def test_perf_torchrpc_nccl():
1616
ctx = mp.get_context("spawn")
1717
with ctx.Pool(processes=2) as pool:
1818
pool.starmap(rpc_model_exchanger, params)
19+
pool.close()
20+
pool.join()

ding/framework/message_queue/tests/test_torch_rpc.py

+6
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ def test_torchrpc():
206206
if platform.system().lower() != 'windows' and torch_ge_1121():
207207
with ctx.Pool(processes=4) as pool:
208208
pool.map(torchrpc, range(4))
209+
pool.close()
210+
pool.join()
209211

210212

211213
@pytest.mark.cudatest
@@ -216,6 +218,8 @@ def test_torchrpc_cuda():
216218
ctx = get_context("spawn")
217219
with ctx.Pool(processes=2) as pool:
218220
pool.map(torchrpc_cuda, range(2))
221+
pool.close()
222+
pool.join()
219223

220224

221225
@pytest.mark.cudatest
@@ -225,3 +229,5 @@ def test_torchrpc_parser():
225229
ctx = get_context("spawn")
226230
with ctx.Pool(processes=1) as pool:
227231
pool.map(torchrpc_args_parser, range(1))
232+
pool.close()
233+
pool.join()

0 commit comments

Comments
 (0)