[dask] speed up tests (#7020)
This commit is contained in:
parent
f79cc4a7a4
commit
25514e104a
@ -28,7 +28,6 @@ if tm.no_dask()['condition']:
|
||||
pytest.skip(msg=tm.no_dask()['reason'], allow_module_level=True)
|
||||
|
||||
from distributed import LocalCluster, Client
|
||||
from distributed.utils_test import client, loop, cluster_fixture
|
||||
import dask.dataframe as dd
|
||||
import dask.array as da
|
||||
from xgboost.dask import DaskDMatrix
|
||||
@ -40,6 +39,20 @@ else:
|
||||
suppress = hypothesis.utils.conventions.not_set # type:ignore
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def cluster():
|
||||
with LocalCluster(
|
||||
n_workers=2, threads_per_worker=2, dashboard_address=None
|
||||
) as dask_cluster:
|
||||
yield dask_cluster
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client(cluster):
|
||||
with Client(cluster) as dask_client:
|
||||
yield dask_client
|
||||
|
||||
|
||||
kRows = 1000
|
||||
kCols = 10
|
||||
kWorkers = 5
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user