Repository navigation
fix(tests): examples run from the suite draw with matplotlib's Agg - #120
Merged
Merged
Conversation
The test run set no MPLBACKEND, so on a machine with a display matplotlib picked TkAgg for an example started through run_python, and 06_mnist_tutorial and the MixUp/CutMix tutorial aborted on "Tcl_AsyncDelete: async handler deleted by the wrong thread" in some runs. CI has no display and never met it. [tool.pytest_env] sets MPLBACKEND to Agg unless the caller set one, the line substrax, calibrax, receptifex and seismifex carry, and run_python hands the test process's environment to each child. substrax's notebook runner sets its own inline backend for a kernel, so pages are unchanged. Two tests pin it: an example's process sees the test run's MPLBACKEND with DISPLAY set, and the pytest-env default is Agg. Both failed before the change. With DISPLAY=:1, the two examples and both tests passed in three runs of three.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
[tool.pytest_env] JAX_SKIP_CUDA_CONSTRAINTS_CHECK = {skip_if_set = true, value = "1"} +MPLBACKEND = {skip_if_set = true, value = "Agg"}An example started from the suite (
run_python, which hands the test process's environment to the child) draws with Agg on every machine, as in substrax, calibrax, receptifex and seismifex. substrax's notebook runner sets its own inline backend for a kernel, so generated pages are unchanged.Evidence
DISPLAY=:1and noMPLBACKEND:06_mnist_tutorialand the MixUp/CutMix tutorial abort withTcl_AsyncDelete: async handler deleted by the wrong threadin some runs (both failed in one run, both passed in the next); with no display both pass. The two new tests fail: the child sees noMPLBACKEND, and[tool.pytest_env]has none.DISPLAY=:1: the two examples and both new tests pass in three runs of three, with no Tcl error. Under Agg matplotlib creates no Tk object. The fast example, tooling-contract and hygiene tests pass, 169 of 169, and the pre-commit hooks pass on the changed files.Merge Danger
Door: two-way
Blast Radius: test environment
MPLBACKENDkeeps theirs (skip_if_set).tests/imports matplotlib apart from the examples' runs and a dependency utility.