Skip to content
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

test_signal: test_stress_modifying_handlers() failed on s390x SLES 3.x #110647

Closed
vstinner opened this issue Oct 10, 2023 · 1 comment
Closed
Labels
tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Oct 10, 2023

See also:

s390x SLES 3.x:

== CPU count: 4
...
0:03:27 load avg: 5.22 [280/467/1] test_signal failed (1 failure) (1 min 10 sec) -- running (1): test.test_multiprocessing_spawn.test_processes (38.4 sec)
(...)
FAIL: test_stress_modifying_handlers (test.test_signal.StressTest.test_stress_modifying_handlers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_signal.py", line 1374, in test_stress_modifying_handlers
    self.assertGreater(num_received_signals, 0)
AssertionError: 0 not greater than 0

Test pass when re-run in verbose mode.

build: https://buildbot.python.org/all/#/builders/540/builds/6801

Linked PRs

@vstinner vstinner added the tests Tests in the Lib/test dir label Oct 10, 2023
@vstinner
Copy link
Member Author

Change to make the error more likely:

diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 2a1a1ee22f..d7017c3281 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -1339,8 +1339,8 @@ def set_interrupts():
                 num_sent_signals += 1
 
         def cycle_handlers():
-            while num_sent_signals < 100:
-                for i in range(20000):
+            while num_sent_signals < 10:
+                for i in range(2000):
                     # Cycle between a Python-defined and a non-Python handler
                     for handler in [custom_handler, signal.SIG_IGN]:
                         signal.signal(signum, handler)

vstinner added a commit to vstinner/cpython that referenced this issue Oct 10, 2023
* cycle_handlers() now waits until at least one signal was received.
* num_received_signals can be equal to num_sent_signals.
vstinner added a commit to vstinner/cpython that referenced this issue Oct 10, 2023
* cycle_handlers() now waits until at least one signal was received.
* num_received_signals can be equal to num_sent_signals.
vstinner added a commit to vstinner/cpython that referenced this issue Oct 10, 2023
* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
vstinner added a commit that referenced this issue Oct 10, 2023
* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 10, 2023
…H-110650)

* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
(cherry picked from commit e07c37c)

Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 11, 2023
…H-110650)

* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
(cherry picked from commit e07c37c)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this issue Oct 11, 2023
) (#110659)

gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650)

* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
(cherry picked from commit e07c37c)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this issue Oct 11, 2023
) (#110658)

gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650)

* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
(cherry picked from commit e07c37c)

Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

1 participant