-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
[NetBSD] test_socket creates too many locks #76106
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
Comments
test_socket creates a lock in the constructor of ThreadSafeCleanupTestCase. But since unittest creates an instance of test class for every test method, it creates around 400 locks. This exceeds the limit of 200 locks in NetBSD 8 and causes a failure. 0:00:00 load avg: 0.00 [1/1] test_socket
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
Traceback (most recent call last):
File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 176, in runtest_inner
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 5801, in test_main
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/support/__init__.py", line 1934, in run_unittest
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/unittest/loader.py", line 503, in makeSuite
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/unittest/loader.py", line 92, in loadTestsFromTestCase
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/unittest/suite.py", line 24, in __init__
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/unittest/suite.py", line 57, in addTests
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 544, in __init__
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 144, in __init__
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/threading.py", line 86, in RLock
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
RuntimeError: can't allocate lock
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/serhiy/py/cpython3.7/Lib/runpy.py", line 193, in _run_module_as_main
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/runpy.py", line 85, in _run_code
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/__main__.py", line 2, in <module>
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 585, in main
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 510, in main
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 536, in _main
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 458, in run_tests
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 379, in run_tests_sequential
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 140, in runtest
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 200, in runtest_inner
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 163, in format_exc
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 117, in format_exception
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 496, in __init__
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 357, in extract
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 281, in line
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 16, in getline
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 47, in getlines
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 136, in updatecache
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
File "/home/serhiy/py/cpython3.7/Lib/tokenize.py", line 447, in open
sem_init: Unknown error: 4294967295
sem_init: Unknown error: 4294967295
RuntimeError: can't allocate read lock |
test_socket creates many locks on all platforms. |
It is a weird test. Initially the lock was introduced in Should the lock be removed at all? Or it is still needed in |
ThreadableTest now uses |
Yeah, it's really bad when a test leaves a thread running a thread in background. It's good that test_socket got fixed. I suppose that this issue can now be closed? |
Sorry, I clicked on close by mistake. |
Removing no longer needed lock will fix the original issue. |
It does not already work (because it locks only addCleanup(), not doCleanups()), and it is no longer needed since the clean up procedure waits for all test threads to join.
It does not already work (because it locks only addCleanup(), not doCleanups()), and it is no longer needed since the clean up procedure waits for all test threads to join. (cherry picked from commit f27b830) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
It does not already work (because it locks only addCleanup(), not doCleanups()), and it is no longer needed since the clean up procedure waits for all test threads to join. (cherry picked from commit f27b830) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: