Skip to content

don't use pg.plot() in tests#2625

Merged
j9ac9k merged 3 commits intopyqtgraph:masterfrom
pijyoi:no-pg-plot
Feb 26, 2023
Merged

don't use pg.plot() in tests#2625
j9ac9k merged 3 commits intopyqtgraph:masterfrom
pijyoi:no-pg-plot

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Feb 24, 2023

There seems to be a new recurring CI segfault on macOS / Python 3.8 / PySide2 5.15.

This PR seems to help to prevent it from happening.

pg.plot() and pg.image() will keep a permanent global reference to their created PlotWidget and ImageView.
This may be a convenience for interactive use, but not suitable for CI where a great many plots are instantiated.

a global reference is kept to all PlotWidgets created by pg.plot()
we are testing ImageItem, not ImageView; and furthermore pg.image()
creates a global reference.

some additional fixes:
1) set lower bound of xRange from "-5+25" to "-5e+25"
   - in practice, it doesn't matter. because we just need xRange
     to be very large.
   - furthermore, ImageView sets the aspect to be locked, so it
     would have been adjusted to follow yRange anyway

2) reduce the qWait time
   - follow what the other tests do and wait for window exposed
a global reference is created by pg.image()
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Feb 26, 2023

Thanks @pijyoi for this PR, always love it when another cause for segfaults in CI is removed!

@j9ac9k j9ac9k merged commit db62778 into pyqtgraph:master Feb 26, 2023
@pijyoi pijyoi deleted the no-pg-plot branch February 26, 2023 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants