Skip to content

TST: Cache available interactive backends#27422

Merged
oscargus merged 1 commit intomatplotlib:mainfrom
QuLogic:test-cache-display
Dec 3, 2023
Merged

TST: Cache available interactive backends#27422
oscargus merged 1 commit intomatplotlib:mainfrom
QuLogic:test-cache-display

Conversation

@QuLogic
Copy link
Copy Markdown
Member

@QuLogic QuLogic commented Dec 2, 2023

PR summary

There are currently 7 backends, and this function is called 8 times during test collection. This means that XOpenDisplay would be called 56 times (multiplied by process count if using xdist).

Locally, I'm seeing a deadlock after too many calls to XOpenDisplay during collection. While this is not directly our bug, it seems prudent to cut this down to only the one check per collection process.

I don't think we can cache this globally, as one might want to re-try a GUI figure after starting an X server (e.g., over SSH or similar), without restarting Python/Matplotlib.

PR checklist

There are currently 7 backends, and this function is called 8 times
during test collection. This means that `XOpenDisplay` would be called
56 times (multiplied by process count if using xdist).

Locally, I'm seeing a deadlock after too many calls to `XOpenDisplay`
during collection. While this is not directly our bug, it seems prudent
to cut this down to only the one check per collection process.

I don't think we can cache this globally, as one might want to re-try a
GUI figure after starting an X server (e.g., over SSH or similar),
without restarting Python/Matplotlib.
@QuLogic QuLogic force-pushed the test-cache-display branch from e0afede to 73b2152 Compare December 2, 2023 10:04
@oscargus oscargus merged commit 5b5154d into matplotlib:main Dec 3, 2023
@tacaswell
Copy link
Copy Markdown
Member

This fixes the collection failure for me as well.

@tacaswell tacaswell added this to the v3.9.0 milestone Dec 4, 2023
@QuLogic QuLogic deleted the test-cache-display branch December 4, 2023 22:53
@QuLogic QuLogic mentioned this pull request Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants