Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokenization-related test tweaks (backport from #8185) #8499

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion distributed/deploy/tests/test_adaptive.py
Original file line number Diff line number Diff line change
@@ -203,7 +203,7 @@ async def test_adapt_quickly():
assert len(adapt.log) == 1

# Scale up when there is plenty of available work
futures = client.map(slowinc, range(1000), delay=0.100)
futures = client.map(slowinc, range(2, 1002), delay=0.100)
while len(adapt.log) == 1:
await asyncio.sleep(0.01)
assert len(adapt.log) == 2
9 changes: 3 additions & 6 deletions distributed/shuffle/tests/test_shuffle.py
Original file line number Diff line number Diff line change
@@ -2479,17 +2479,14 @@ def test_set_index_with_existing_index(client):


def test_sort_values_with_existing_divisions(client):
"Regression test for #8165"
"""Regression test for #8165"""
df = pd.DataFrame(
{"a": np.random.randint(0, 3, 20), "b": np.random.randint(0, 3, 20)}
)
ddf = dd.from_pandas(
df,
npartitions=4,
)
ddf = dd.from_pandas(df, npartitions=4)
with dask.config.set({"dataframe.shuffle.method": "p2p"}):
ddf = ddf.set_index("a").sort_values("b")
result = client.compute(ddf, sync=True)
result = ddf.compute()
dd.assert_eq(
result,
df.set_index("a").sort_values("b"),
4 changes: 2 additions & 2 deletions distributed/tests/test_scheduler.py
Original file line number Diff line number Diff line change
@@ -624,7 +624,7 @@ def func(first, second):
secede()
second.wait()

fs = c.map(func, [first] * 5, [second] * 5)
fs = c.map(func, [first] * 5, [second] * 5, key=[f"x{i}" for i in range(5)])
Copy link
Collaborator Author

@crusaderky crusaderky Feb 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With dask/dask#10883, func no longer tokenizes to 5 different random values, so we ended up with a single key.

await async_poll_for(lambda: a.state.executing, timeout=5)

await first.set()
@@ -2641,7 +2641,7 @@ async def test_adaptive_target(c, s, a, b):
assert s.adaptive_target() == 1

# Long task
x = c.submit(slowinc, 1, delay=0.5)
x = c.submit(slowinc, 1, delay=0.4)
while x.key not in s.tasks:
await asyncio.sleep(0.01)
assert s.adaptive_target(target_duration=".1s") == 1 # still one