You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MNT]: Flaky Windows_py31x tests on Azure Pipelines #29797
The Windows_py310 Azure Pipelines test jobs run by GitHub Actions for this repo appear to be unreliable at the moment.
Test timeouts and failures have occurred on both pull requests and mainline branch checks, and the failures do not appear related to the commits-under-test:
Note: This flaky behavior exists for some time now. Hard to reconstruct, but likely at least since the beginning of the year. While the CI run details have been cleaned up, I suspect that e.g. the following PRs were affected #29494 (Jan 20, 2025), #29358 (Dec 30, 2024), #29262 (Dec 9, 2024).
Question: do all of the test cases that exhibit this use subprocess.PIPE for output/stderr? Initially I think: yes; but I haven't confirmed that exhaustively.
Superficially the failures appear similar to this bugreport (note: the PR mentioned in the description is where the bug was encountered -- not a subsequent PR to address it): python/cpython#85481
I think it's unlikely to be due to a bug in matplotlib itself, so to that extent I agree it's not worth spending much time on - I reckon it's more likely to be an artifact of the subprocess calls from the test suite.
Even so: if it's a sample case for a problem that could be figured out and resolved elsewhere, then that could be helpful (and eventually provide reduced test flakiness, meaning fewer distractions/delays, here as a benefit).
Activity
jayaddison commentedon Mar 24, 2025
This does also occur, albeit less frequently, on
Windows_py312; e.g. here: https://dev.azure.com/matplotlib/matplotlib/_build/results?buildId=43004&view=logs&jobId=f92c32cd-721a-536e-3a87-a0c010db3f7f&j=f92c32cd-721a-536e-3a87-a0c010db3f7f&t=d4eecd58-7131-52e4-f793-e9e3ca32dedbA commonality between the failure cases seems to be that one or more
subprocess-related tests fails, usually due to a timeout.[-][MNT]: Flaky Windows_py310 test on Azure Pipelines[/-][+][MNT]: Flaky Windows_py31x tests on Azure Pipelines[/+]timhoffm commentedon Mar 24, 2025
Note: This flaky behavior exists for some time now. Hard to reconstruct, but likely at least since the beginning of the year. While the CI run details have been cleaned up, I suspect that e.g. the following PRs were affected #29494 (Jan 20, 2025), #29358 (Dec 30, 2024), #29262 (Dec 9, 2024).
jayaddison commentedon Mar 24, 2025
Question: do all of the test cases that exhibit this use
subprocess.PIPEfor output/stderr? Initially I think: yes; but I haven't confirmed that exhaustively.Superficially the failures appear similar to this bugreport (note: the PR mentioned in the description is where the bug was encountered -- not a subsequent PR to address it): python/cpython#85481
dstansby commentedon Mar 26, 2025
Sionce these are all on Python 3.10 (I think?), and according to NEP29 we can drop support for Python 3.10 on 4th April (https://numpy.org/neps/nep-0029-deprecation_policy.html#support-table), it's probably not worth spending much time looking into this?
timhoffm commentedon Mar 26, 2025
Not quite, it also happens on newer python versions, e.g. #29797 (comment). But apparently less frequently.
jayaddison commentedon Apr 1, 2025
I think it's unlikely to be due to a bug in
matplotlibitself, so to that extent I agree it's not worth spending much time on - I reckon it's more likely to be an artifact of the subprocess calls from the test suite.Even so: if it's a sample case for a problem that could be figured out and resolved elsewhere, then that could be helpful (and eventually provide reduced test flakiness, meaning fewer distractions/delays, here as a benefit).
timhoffm commentedon Apr 26, 2025
I have no statistics, but the issue still happens on 3.11, and I have the feeling that it's more common now on 3.11 since we have removed 3.10. 🤔
tacaswell commentedon Apr 28, 2025
https://dev.azure.com/matplotlib/matplotlib/_build/results?buildId=43612&view=logs&j=c0a65fc6-a4f7-5116-4cee-beb3104aaa7c&t=ccc2daa7-0687-5084-0ea1-0e98a3640679&l=196
The odd thing to me is that the test that fails is
test_axeswidget_interactive, but the communication failure talks aboutwhich makes me think we are somehow crossing state what launching the subprocesses.
FIX: Move all tests using subprocess to the same worker on windows
FIX: Move all tests using subprocess to the same worker on windows
FIX: Move all tests using subprocess to the same worker on windows
FIX: Move all tests using subprocess to the same worker on windows
FIX: Move all tests using subprocess to the same worker on windows
timhoffm commentedon Apr 29, 2025
Confirmation from #29986
timhoffm commentedon Apr 29, 2025
This may be a bad interaction between pytest-xdist and pytest-timeout. Related topics (I have not yet dug into them in detail):
rcomer commentedon Apr 30, 2025
When we dropped py310 we switched py311 to use the windows-2019 image. Could the image be the problem? I went searching for info about it and (if I’m looking at the right thing?) it is soon to be deprecated
actions/runner-images#12045
Link found via the "included software" column in the table here: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml
timhoffm commentedon May 1, 2025
Good observation. Certainly worth a try to see whether switching to windows-2022 or windows-latest fixes the issue.
Update pinned oldest win image on azure
Update pinned oldest win image on azure
Update pinned oldest win image on azure
Update pinned oldest win image on azure
timhoffm commentedon May 5, 2025
Closing, assuming this is fixed through #29992. We can always reopen if the issue comes up again.
jayaddison commentedon May 5, 2025
Thank you @timhoffm!
timhoffm commentedon May 5, 2025
Credit for the solution goes to @rcomer: Thank you!