Skip to content

Commit 9442bdf

Browse files
committed
avoid test failure
1 parent 39359c7 commit 9442bdf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/python_package_test/test_dask.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,11 @@ def test_network_params_not_required_but_respected_if_given(client, task, output
10571057

10581058
# model 2 - machines given
10591059
n_workers = len(client.scheduler_info()['workers'])
1060-
open_ports = [lgb.dask._find_random_open_port() for _ in range(n_workers)]
1060+
while True:
1061+
open_ports = [lgb.dask._find_random_open_port() for _ in range(n_workers)]
1062+
if len(set(open_ports)) == len(open_ports):
1063+
break
1064+
10611065
dask_model2 = dask_model_factory(
10621066
n_estimators=5,
10631067
num_leaves=5,

0 commit comments

Comments
 (0)