Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TST: force test with shared test image to run in serial#24081

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 1 commit intomatplotlib:mainfromtacaswell:fix_shared_test_image
Oct 4, 2022

Conversation

tacaswell
Copy link
Member

PR Summary

The tests test_hexbin_empty and test_hexbin_log_empty use the same target image, however if they the tests ended up being run in different workers when running the tests in parallel they will step on each other if one of the test starts writing the output file while the other is trying to read the test image.

By putting them in the same test they will save and evaluate in order.

I verified I could break both tests.

The other option here is to make a copy of the file (which should be free at the git level due to content based addressing). I am happy to switch to that if the consensus that is a better approach happy to switch (I was very much on the fence).

This should fix the current rash of transient failures. We are running-n 2 on CI so we need to get unlucky that the tests go to different workers and that they run close enough in time to matter which is why we only see in 1-2 jobs per CI run and re-running seems to reliably fix it.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

The tests test_hexbin_empty and test_hexbin_log_empty use the same targetimage, however if they the tests ended up being run in different workers whenrunning the tests in parallel they will step on each other if one of the teststarts writing the output file while the other is trying to read the testimage.By putting them in the same test they will save and evaluate in order.
@tacaswelltacaswell added this to thev3.7.0 milestoneOct 2, 2022
Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

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

I think either way is good enough here. Please add a comment that they have to be together, so that nobody comes along and splits the test later. - Thinking about it, given the need for a note to prevent future breakage and related complexity/mental load, maybe copying the image is the easier solution.

Theoretically, the best solution would be to solve this on the test infrastructure level. Conceptually, there should not be a problem with multiple tests using the same reference image - the reference image should be read-only. But maybe fixing this is more effort than it's worth. It's not that common that multiple tests generate the same image.

@tacaswell
Copy link
MemberAuthor

#16735 is some prior art on this (where we discussed adding file locking).

I remember we had a PR that was adding some randomness to the initial file written, but I am not able to find it. However I think even if we fixed that we would still have some issues if multiple failed because of the way we name the expected / diff files.

Maybe we need some logic to audit the names and make sure we do not have the reused files between tests (I think we know enough as part of the collection phase to determine that).

@QuLogicQuLogic merged commit76a5711 intomatplotlib:mainOct 4, 2022
@tacaswelltacaswell deleted the fix_shared_test_image branchOctober 4, 2022 13:44
@QuLogicQuLogic modified the milestones:v3.7.0,v3.6.2Oct 17, 2022
@QuLogic
Copy link
Member

meeseeksdev backport to v3.6.x

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestOct 17, 2022
QuLogic added a commit that referenced this pull requestOct 17, 2022
…081-on-v3.6.xBackport PR#24081 on branch v3.6.x (TST: force test with shared test image to run in serial)
@ksundenksunden mentioned this pull requestFeb 20, 2023
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.6.2
Development

Successfully merging this pull request may close these issues.

3 participants
@tacaswell@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp