File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5151 - name : decorator smoke test
5252 run : python test/smoketest_profile_decorator.py
5353
54+ # NOTE: this is a regression test for signals not being
55+ # restarted properly. It checks whether the program
56+ # halts or runs forever, not for correctness of timing.
57+ - name : signal smoketest
58+ run : python test/smoketest.py test/signal_test.py
59+ timeout-minutes : 0.5
5460 # FIXME: these tests are broken under the current Github runner
5561 #
5662 # - name: line invalidation test
Original file line number Diff line number Diff line change @@ -731,7 +731,6 @@ def cpu_signal_handler(
731731 to_wait = min (remaining_time , next_interval )
732732 else :
733733 to_wait = next_interval
734- Scalene .client_timer .reset ()
735734 Scalene .__signal_manager .restart_timer (to_wait )
736735 else :
737736 Scalene .__signal_manager .restart_timer (next_interval )
Original file line number Diff line number Diff line change 1+ import signal
2+
3+ iterations = 10
4+
5+ def my_handler (sig , frame ):
6+ global iterations
7+ print (f"seconds remaining: { iterations } " )
8+ if iterations > 0 :
9+ iterations -= 1
10+ signal .setitimer (signal .ITIMER_REAL , 1.0 , 0 )
11+
12+ signal .signal (signal .SIGALRM , my_handler )
13+ signal .setitimer (signal .ITIMER_REAL , 1.0 , 0 )
14+
15+ while iterations :
16+ signal .pause ()
You can’t perform that action at this time.
0 commit comments