Skip to content

Commit 85f8f9a

Browse files
committed
Fix failing tests
1 parent 9b905d8 commit 85f8f9a

File tree

6 files changed

+33
-18
lines changed

6 files changed

+33
-18
lines changed

continuous_integration/environment-3.14.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
- coverage
1313
- dask # overridden by git tip below
1414
- fsspec # overridden by git tip below
15-
# - gilknocker # Not yet available for Python 3.14
15+
# - gilknocker # conda-forge package not yet available for Python 3.14
1616
- h5py
1717
- ipykernel
1818
- ipywidgets
@@ -52,3 +52,4 @@ dependencies:
5252
- git+https://github.com/dask/zict
5353
- git+https://github.com/fsspec/filesystem_spec
5454
- keras
55+
- gilknocker # conda-forge package not yet available for Python 3.14

distributed/client.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3250,8 +3250,20 @@ def _get_computation_code(
32503250
"|".join([f"(?:{mod})" for mod in ignore_modules])
32513251
)
32523252
if ignore_files:
3253+
# Given ignore-files = [foo], match:
3254+
# /path/to/foo
3255+
# /path/to/foo.py[c]
3256+
# /path/to/foo/bar.py[c]
3257+
# \path\to\foo
3258+
# \path\to\foo.py[c]
3259+
# \path\to\foo\bar.py[c]
3260+
# <frozen foo>
3261+
# Do not match files that have 'foo' as a substring,
3262+
# unless the user explicitly states '.*foo.*'.
3263+
ignore_files_or = "|".join(mod for mod in ignore_files)
32533264
fname_pattern = re.compile(
3254-
r".*[\\/](" + "|".join(mod for mod in ignore_files) + r")([\\/]|$)"
3265+
rf".*[\\/]({ignore_files_or})([\\/]|\.pyc?$|$)"
3266+
rf"|<frozen ({ignore_files_or})>$"
32553267
)
32563268
else:
32573269
# stacklevel 0 or less - shows dask internals which likely isn't helpful

distributed/cluster_dump.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ def to_yamls(
304304
import yaml
305305

306306
root_dir = Path(root_dir) if root_dir else Path.cwd()
307-
dumper = yaml.CSafeDumper
307+
# Note: libyaml bindings are optional;
308+
# e.g. https://github.com/conda-forge/pyyaml-feedstock/issues/59
309+
dumper = getattr(yaml, "CSafeDumper", yaml.SafeDumper)
308310
scheduler_expand_keys = set(scheduler_expand_keys)
309311
worker_expand_keys = set(worker_expand_keys)
310312

distributed/distributed.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,15 @@ distributed:
289289
- __channelexec__ # more xdist
290290
- execnet # more xdist
291291
ignore-files:
292-
- runpy\.py # `python -m pytest` (or other module) shell command
293-
- pytest # `pytest` shell command
294-
- py\.test # `py.test` shell command
295-
- pytest-script\.py # `pytest` shell command in Windows
296-
- _pytest # pytest implementation
292+
# `python -m pytest` (or other module)
293+
# runpy.py on Python <=3.13; <frozen runpy> on >=3.14
294+
- runpy
295+
# Many variations of pytest:
296+
# pytest, py.test, pytest-script (on Windows),
297+
# _pytest (implementation), vscode_pytest
298+
- .*py\.?test.*
297299
- pycharm # Run pytest from PyCharm GUI
298-
- vscode_pytest
299-
- get_output_via_markers\.py
300+
- get_output_via_markers
300301
erred-tasks:
301302
max-history: 100
302303

distributed/protocol/tests/test_protocol.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,15 @@ def test_sizeof_serialize(Wrapper, Wrapped):
162162
@pytest.mark.skipif(WINDOWS, reason="On windows this is triggering a stackoverflow")
163163
def test_deeply_nested_structures():
164164
# These kind of deeply nested structures are generated in our profiling code
165-
def gen_deeply_nested(depth, msg=None):
166-
d = msg or {}
167-
while depth:
168-
depth -= 1
165+
def gen_deeply_nested(depth):
166+
d = {}
167+
for _ in range(depth):
169168
d = {"children": d}
170169
return d
171170

172-
msg = {}
173-
for _ in range(10):
174-
msg = gen_deeply_nested(sys.getrecursionlimit() // 2, msg=msg)
171+
# Note: Python <=3.13 already fails with 2x the recursion limit;
172+
# 3.14 keeps working until 14x for some reason
173+
msg = gen_deeply_nested(sys.getrecursionlimit() * 14)
175174

176175
with pytest.raises(RecursionError):
177176
copy.deepcopy(msg)

distributed/shuffle/tests/test_shuffle_plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from __future__ import annotations
22

3-
from asyncio import iscoroutinefunction
43

54
import pytest
65

76
from distributed.shuffle._scheduler_plugin import ShuffleSchedulerPlugin
87
from distributed.shuffle._worker_plugin import ShuffleWorkerPlugin
8+
from distributed.utils import iscoroutinefunction
99
from distributed.utils_test import gen_cluster
1010

1111
pd = pytest.importorskip("pandas")

0 commit comments

Comments
 (0)