{{ message }}
FIX: macos: Add update capability to interval/singleshot timer properties - #29018
Closed
greglucas wants to merge 4 commits into
Closed
FIX: macos: Add update capability to interval/singleshot timer properties#29018greglucas wants to merge 4 commits into
greglucas wants to merge 4 commits into
Conversation
greglucas
force-pushed
the
macos-timer-updates
branch
5 times, most recently
from
October 24, 2024 21:11
9a99838 to
e60da20
Compare
greglucas
commented
Oct 24, 2024
Comment on lines
+652
to
+653
Contributor
Author
There was a problem hiding this comment.
This is really annoying to wrestle with CI sometimes. I have no idea why the macos CI runners would have ~60 calls, but my local version and the linux runners get the correct ~20 calls.
If anyone has better ideas for how to test these timers let me know too. Each new test/"pause" we add here adds 2 seconds * nbackends / njobs to the test runs and it looks like this test is currently one of the longest running in the suite at around ~10s.
Member
There was a problem hiding this comment.
Did plt.pause not run for the expected pause_time, perhaps?
Contributor
Author
There was a problem hiding this comment.
That is a good thought! That led me to a few refactors here which I pushed up as separate commits.
- I removed
plt.pause()and went directly tostart_event_loop()now in case there was additional overhead in any of the pause draw calls. - I parallelized the tests now so we only run two "pauses" and test multiple things during each pause.
- I noticed that GTK doesn't implement its own
start_event_loop()and our current default one inbackend_bases.pycould run longer than expected ifflush_events()added time to the loop. So I changed this in the final commit to be dependent on the run-time, not the number of iterations of sleep.
greglucas
force-pushed
the
macos-timer-updates
branch
from
October 25, 2024 15:01
f6e282b to
b98b898
Compare
The implementation of start_event_loop would previously just count the number of sleeps that occurred. But this could lead to longer event loop times if flush_events() added time into the loop. We want the condition to be dependent on the end-time so we don't run our loop longer than necessary.
greglucas
force-pushed
the
macos-timer-updates
branch
from
October 25, 2024 22:50
87bfe62 to
2d7a86f
Compare
2 tasks
Contributor
Author
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.

PR summary
As noted by @dopplershift here #28997 (comment)
The macos timers didn't get updated when a user would update the timer interval
timer.interval = newvalue(in that example a new timer is created and then an interval is set with the delay).This adds tests for the timer updates as well.
PR checklist