[dask] Improve configuration for port. (#7645)

- Try port 0 to let the OS return the available port.
- Add port configuration.
This commit is contained in:
Jiaming Yuan
2022-02-14 21:34:34 +08:00
committed by GitHub
parent b52c4e13b0
commit 5cd1f71b51
5 changed files with 51 additions and 25 deletions

View File

@@ -1228,6 +1228,10 @@ class TestWithDask:
with pytest.raises(ValueError):
xgb.dask.train(client, {}, dtrain, num_boost_round=4)
with dask.config.set({'xgboost.scheduler_address': "127.0.0.1:22"}):
with pytest.raises(PermissionError):
xgb.dask.train(client, {}, dtrain, num_boost_round=1)
def run_updater_test(
self,
client: "Client",