Skip to content

Commit 3524a2f

Browse files
committed
gh-130917: update workload for test_signal.test_itimer_virtual
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.
1 parent 9c69150 commit 3524a2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_signal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def test_itimer_virtual(self):
842842

843843
for _ in support.busy_retry(support.LONG_TIMEOUT):
844844
# use up some virtual time by doing real work
845-
_ = pow(12345, 67890, 10000019)
845+
_ = sum(i * i for i in range(10**5))
846846
if signal.getitimer(self.itimer) == (0.0, 0.0):
847847
# sig_vtalrm handler stopped this itimer
848848
break
@@ -859,7 +859,7 @@ def test_itimer_prof(self):
859859

860860
for _ in support.busy_retry(support.LONG_TIMEOUT):
861861
# do some work
862-
_ = pow(12345, 67890, 10000019)
862+
_ = sum(i * i for i in range(10**5))
863863
if signal.getitimer(self.itimer) == (0.0, 0.0):
864864
# sig_prof handler stopped this itimer
865865
break

0 commit comments

Comments
 (0)