Skip to content

Commit

Permalink
restore test_warn_when_submitting_large_values warning check
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Apr 11, 2022
1 parent 0dd67fa commit 8f11999
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions distributed/tests/test_client.py
Expand Up @@ -13,6 +13,7 @@
import threading
import traceback
import types
import warnings
import weakref
import zipfile
from collections import deque
Expand Down Expand Up @@ -5653,15 +5654,18 @@ async def test_config_scheduler_address(s, a, b):
async def test_warn_when_submitting_large_values(c, s, a, b):
with pytest.warns(
UserWarning,
match=r"Large object of size (2\.00 MB|1.91 MiB) detected in task graph:\s+"
r"\(b'0+ \.\.\. 0+',\)\s+"
r"Consider scattering large objects ahead of time.*",
) as exc_info:
match=r"Large object of size (2\.00 MB|1.91 MiB) detected in task graph:"
r" \n \(b'00000000000000000000000000000000000000000000000 \.\.\. 000000000000',\)"
r"\nConsider scattering large objects ahead of time.*",
):
future = c.submit(lambda x: x + 1, b"0" * 2000000)

data = b"0" * 2000000
for i in range(10):
future = c.submit(lambda x, y: x, data, i)
with warnings.catch_warnings(record=True) as record:
data = b"0" * 2000000
for i in range(10):
future = c.submit(lambda x, y: x, data, i)

assert not record


@gen_cluster(client=True)
Expand Down

0 comments on commit 8f11999

Please sign in to comment.