mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-30107: don't dump core on expected test_io crash (#1235)
test_io has two unit tests which trigger a deadlock: * test_daemon_threads_shutdown_stdout_deadlock() * test_daemon_threads_shutdown_stderr_deadlock() These tests call Py_FatalError() if the expected bug is triggered which calls abort(). Use test.support.SuppressCrashReport to prevent the creation on a core dump, to fix the warning: Warning -- files was modified by test_io Before: [] After: ['python.core']
This commit is contained in:
parent
a2c877c398
commit
2a1aed04b0
1 changed files with 5 additions and 0 deletions
|
@ -3732,6 +3732,7 @@ class CMiscIOTest(MiscIOTest):
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
|
from test.support import SuppressCrashReport
|
||||||
|
|
||||||
file = sys.{stream_name}
|
file = sys.{stream_name}
|
||||||
|
|
||||||
|
@ -3740,6 +3741,10 @@ class CMiscIOTest(MiscIOTest):
|
||||||
file.write('.')
|
file.write('.')
|
||||||
file.flush()
|
file.flush()
|
||||||
|
|
||||||
|
crash = SuppressCrashReport()
|
||||||
|
crash.__enter__()
|
||||||
|
# don't call __exit__(): the crash occurs at Python shutdown
|
||||||
|
|
||||||
thread = threading.Thread(target=run)
|
thread = threading.Thread(target=run)
|
||||||
thread.daemon = True
|
thread.daemon = True
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue