summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_signal.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_signal.py')
-rw-r--r--Lib/test/test_signal.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 7f8fe34..da36b85 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -1325,15 +1325,18 @@ class StressTest(unittest.TestCase):
def handler(signum, frame):
sigs.append(signum)
- self.setsig(signal.SIGUSR1, handler)
+ # On Android, SIGUSR1 is unreliable when used in close proximity to
+ # another signal – see Android/testbed/app/src/main/python/main.py.
+ # So we use a different signal.
+ self.setsig(signal.SIGUSR2, handler)
self.setsig(signal.SIGALRM, handler) # for ITIMER_REAL
expected_sigs = 0
while expected_sigs < N:
# Hopefully the SIGALRM will be received somewhere during
- # initial processing of SIGUSR1.
+ # initial processing of SIGUSR2.
signal.setitimer(signal.ITIMER_REAL, 1e-6 + random.random() * 1e-5)
- os.kill(os.getpid(), signal.SIGUSR1)
+ os.kill(os.getpid(), signal.SIGUSR2)
expected_sigs += 2
# Wait for handlers to run to avoid signal coalescing