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

Detect mismatching Python version in scheduler #7018

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions distributed/tests/test_versions.py
Expand Up @@ -107,16 +107,23 @@ def test_scheduler_additional_irrelevant_package(kwargs_matching):
assert error_message(**kwargs_matching)["warning"] == ""


def test_python_mismatch(kwargs_matching):
kwargs_matching["source"]["packages"]["python"] = "0.0.0"
msg = error_message(**kwargs_matching)
def test_python_mismatch(kwargs_matching, node):
column_matching = {"source": 1, "scheduler": 2, "workers": 3}
i = column_matching.get(node, 3)
mismatch_version = "0.0.0"
kwargs = kwargs_matching
if node in kwargs["workers"]:
kwargs["workers"][node]["packages"]["python"] = mismatch_version
else:
kwargs[node]["packages"]["python"] = mismatch_version
msg = error_message(**kwargs)
assert "Mismatched versions found" in msg["warning"]
assert "python" in msg["warning"]
assert (
"0.0.0"
in re.search(r"python\s+(?:(?:\|[^|\r\n]*)+\|(?:\r?\n|\r)?)+", msg["warning"])
.group(0)
.split("|")[1]
.split("|")[i]
.strip()
)

Expand Down
2 changes: 1 addition & 1 deletion distributed/versions.py
Expand Up @@ -29,7 +29,7 @@


# only these scheduler packages will be checked for version mismatch
scheduler_relevant_packages = {pkg for pkg, _ in required_packages} | {"lz4"}
scheduler_relevant_packages = {pkg for pkg, _ in required_packages} | {"lz4", "python"}


# notes to be displayed for mismatch packages
Expand Down