Skip to content

gh-130917: update timer and workload in test_signal #130918

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 7, 2025

Conversation

diegorusso
Copy link
Contributor

@diegorusso diegorusso commented Mar 6, 2025

The workload to advance the virtual timeout is too lightweight for some platforms. As result the test goes in timeout as it never reaches the end of the timer.
By having a heavier workload and a shorter timer value, the virtual timer reaches the end rapidly and the SIGVTALRM is sent before the test LONG_TIMEOUT.

The workload to advance the virtual timeout is too lightweight for
some platforms. As result the test goes in timeout as it never reaches
the end of the timer.
By having a heavier workload, the virtual timer advances rapidly and the
SIGVTALRM is sent before the timeout.
@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting review labels Mar 6, 2025
@diegorusso diegorusso added skip news and removed tests Tests in the Lib/test dir awaiting review labels Mar 6, 2025
@diegorusso diegorusso changed the title gh-130917: update workload for test_signal.test_itimer_virtual gh-130917: update workload for test_signal.test_itimer_virtual/prof Mar 6, 2025
@colesbury
Copy link
Contributor

Can we make the delay and interval in, e.g., signal.setitimer(self.itimer, 0.3, 0.2) much shorter? Like signal.setitimer(self.itimer, 0.0001, 0.0001). It should make the test faster and more robust to the choice of "work".

@diegorusso
Copy link
Contributor Author

Can we make the delay and interval in, e.g., signal.setitimer(self.itimer, 0.3, 0.2) much shorter? Like signal.setitimer(self.itimer, 0.0001, 0.0001). It should make the test faster and more robust to the choice of "work".

OK, this is actually a good point. Let me experiment with a few timer values.

@diegorusso diegorusso changed the title gh-130917: update workload for test_signal.test_itimer_virtual/prof gh-130917: decrease timer for test_signal.test_itimer_virtual Mar 6, 2025
@diegorusso diegorusso requested a review from colesbury March 6, 2025 23:29
@colesbury
Copy link
Contributor

I think your sum() change was good as well! I think it's worth doing both.

@diegorusso diegorusso changed the title gh-130917: decrease timer for test_signal.test_itimer_virtual gh-130917: update timer and workload in test_signal Mar 6, 2025
@diegorusso
Copy link
Contributor Author

I think your sum() change was good as well! I think it's worth doing both.

Done! :)

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

LGTM!

@colesbury colesbury merged commit 7879081 into python:main Mar 7, 2025
40 checks passed
@diegorusso diegorusso deleted the gh-130917 branch March 7, 2025 22:17
@diegorusso
Copy link
Contributor Author

@Yhg1s should we back port this PR to 3.12 and 3.13?

@ned-deily
Copy link
Member

ned-deily commented Mar 8, 2025

@Yhg1s should we back port this PR to 3.12 and 3.13?

Yes, this problem is observable there as well. I believe the only reason it hasn't been an issue with our CI is that it currently only seems to show up with non-debug builds on ARM Macs probably due to a combination of the CPU speed and code generated for ARM.

@colesbury colesbury added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Mar 8, 2025
@miss-islington-app
Copy link

Thanks @diegorusso for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @diegorusso for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 8, 2025
…30918)

The workload to advance the virtual timeout is too lightweight for some
platforms. As result the test goes in timeout as it never reaches the
end of the timer. By having a heavier workload, the virtual timer
advances rapidly and the SIGVTALRM is sent before the timeout.
(cherry picked from commit 7879081)

Co-authored-by: Diego Russo <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Mar 8, 2025

GH-130968 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Mar 8, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 8, 2025
…30918)

The workload to advance the virtual timeout is too lightweight for some
platforms. As result the test goes in timeout as it never reaches the
end of the timer. By having a heavier workload, the virtual timer
advances rapidly and the SIGVTALRM is sent before the timeout.
(cherry picked from commit 7879081)

Co-authored-by: Diego Russo <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Mar 8, 2025

GH-130969 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 8, 2025
colesbury pushed a commit that referenced this pull request Mar 8, 2025
#130969)

The workload to advance the virtual timeout is too lightweight for some
platforms. As result the test goes in timeout as it never reaches the
end of the timer. By having a heavier workload, the virtual timer
advances rapidly and the SIGVTALRM is sent before the timeout.
(cherry picked from commit 7879081)

Co-authored-by: Diego Russo <[email protected]>
colesbury pushed a commit that referenced this pull request Mar 8, 2025
#130968)

The workload to advance the virtual timeout is too lightweight for some
platforms. As result the test goes in timeout as it never reaches the
end of the timer. By having a heavier workload, the virtual timer
advances rapidly and the SIGVTALRM is sent before the timeout.
(cherry picked from commit 7879081)

Co-authored-by: Diego Russo <[email protected]>
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
)

The workload to advance the virtual timeout is too lightweight for some
platforms. As result the test goes in timeout as it never reaches the
end of the timer. By having a heavier workload, the virtual timer
advances rapidly and the SIGVTALRM is sent before the timeout.
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.

3 participants