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
Rework some tests related to gather_dep #6472
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
efb2dd9
Revisit some tests related to gather_dep
crusaderky d8315eb
Code review
crusaderky 7c2a0c1
Merge branch 'main' into WSMR/clustered_transfers_tests
crusaderky 8d5d50e
Merge branch 'main' into WSMR/clustered_transfers_tests
crusaderky 0920c47
Merge branch 'main' into WSMR/clustered_transfers_tests
crusaderky 8136bae
Rescope
crusaderky 51a3ba9
Merge branch 'main' into WSMR/clustered_transfers_tests
crusaderky File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -745,17 +745,18 @@ async def test_clean_nbytes(c, s, a, b): | |
|
||
|
||
@pytest.mark.parametrize("as_deps", [True, False]) | ||
@gen_cluster(client=True, nthreads=[("", 1)] * 20) | ||
async def test_gather_many_small(c, s, a, *workers, as_deps): | ||
"""If the dependencies of a given task are very small, do not limit the | ||
number of concurrent outgoing connections | ||
@gen_cluster(client=True, nthreads=[("", 1)] * 21) | ||
async def test_gather_many_small(c, s, a, *snd_workers, as_deps): | ||
"""If the dependencies of a given task are very small, do not limit the number of | ||
concurrent outgoing connections. If multiple small fetches from the same worker are | ||
scheduled all at once, they will result in a single call to gather_dep. | ||
""" | ||
a.total_out_connections = 2 | ||
futures = await c.scatter( | ||
{f"x{i}": i for i in range(100)}, | ||
workers=[w.address for w in workers], | ||
workers=[w.address for w in snd_workers], | ||
) | ||
assert all(w.data for w in workers) | ||
assert all(w.data for w in snd_workers) | ||
|
||
if as_deps: | ||
future = c.submit(lambda _: None, futures, key="y", workers=[a.address]) | ||
|
@@ -765,13 +766,18 @@ async def test_gather_many_small(c, s, a, *workers, as_deps): | |
while len(a.data) < 100: | ||
await asyncio.sleep(0.01) | ||
|
||
types = list(pluck(0, a.log)) | ||
req = [i for i, t in enumerate(types) if t == "request-dep"] | ||
recv = [i for i, t in enumerate(types) if t == "receive-dep"] | ||
assert len(req) == len(recv) == 19 | ||
assert min(recv) > max(req) | ||
assert a.comm_nbytes == 0 | ||
|
||
story = a.story("request-dep", "receive-dep") | ||
assert len(story) == 40 # 1 request-dep + 1 receive-dep per sender worker | ||
# All GatherDep instructions are fired at the same time; each fetches all keys | ||
# available on the sender worker | ||
for ev in story[:20]: | ||
assert ev[0] == "request-dep" | ||
assert len(ev[2]) > 1 | ||
for ev in story[20:]: | ||
assert ev[0] == "receive-dep" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tighten tested condition + clarifications |
||
|
||
|
||
@gen_cluster(client=True, nthreads=[("127.0.0.1", 1)] * 3) | ||
async def test_multiple_transfers(c, s, w1, w2, w3): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tightened tested conditions