https://github.com/python/cpython/commit/597a953484c28a07fe1c81a76db0a58985959d12
commit: 597a953484c28a07fe1c81a76db0a58985959d12
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: colesbury <colesb...@gmail.com>
date: 2025-03-08T01:05:29Z
summary:

[3.13] gh-130917: update timer and workload in test_signal (GH-130918) (#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 78790811989ab47319e2ee725e0c435b3cdd21ab)

Co-authored-by: Diego Russo <diego.ru...@arm.com>

files:
M Lib/test/test_signal.py

diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 08f18a99f8d0e3..e69b4452f53f94 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -840,11 +840,11 @@ def test_itimer_real(self):
     def test_itimer_virtual(self):
         self.itimer = signal.ITIMER_VIRTUAL
         signal.signal(signal.SIGVTALRM, self.sig_vtalrm)
-        signal.setitimer(self.itimer, 0.3, 0.2)
+        signal.setitimer(self.itimer, 0.001, 0.001)
 
         for _ in support.busy_retry(support.LONG_TIMEOUT):
             # use up some virtual time by doing real work
-            _ = pow(12345, 67890, 10000019)
+            _ = sum(i * i for i in range(10**5))
             if signal.getitimer(self.itimer) == (0.0, 0.0):
                 # sig_vtalrm handler stopped this itimer
                 break
@@ -861,7 +861,7 @@ def test_itimer_prof(self):
 
         for _ in support.busy_retry(support.LONG_TIMEOUT):
             # do some work
-            _ = pow(12345, 67890, 10000019)
+            _ = sum(i * i for i in range(10**5))
             if signal.getitimer(self.itimer) == (0.0, 0.0):
                 # sig_prof handler stopped this itimer
                 break

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to