deliberately crashing tests should prevent core dumps #63148
Copy link
Copy link
Closed
Labels
easytestsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Description
| BPO | 18948 |
|---|---|
| Nosy | @pitrou, @vstinner, @zware |
| Files |
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:
assignee = None
closed_at = <Date 2013-10-08.21:05:58.300>
created_at = <Date 2013-09-06.18:56:05.249>
labels = ['easy', 'type-feature', 'tests']
title = 'deliberately crashing tests should prevent core dumps'
updated_at = <Date 2013-10-08.21:05:58.299>
user = 'https://github.com/pitrou'bugs.python.org fields:
activity = <Date 2013-10-08.21:05:58.299>
actor = 'pitrou'
assignee = 'none'
closed = True
closed_date = <Date 2013-10-08.21:05:58.300>
closer = 'pitrou'
components = ['Tests']
creation = <Date 2013-09-06.18:56:05.249>
creator = 'pitrou'
dependencies = []
files = ['31743', '31752', '31987']
hgrepos = []
issue_num = 18948
keywords = ['patch', 'easy']
message_count = 11.0
messages = ['197090', '197602', '197661', '197679', '197907', '198766', '198768', '199161', '199164', '199248', '199250']
nosy_count = 6.0
nosy_names = ['pitrou', 'vstinner', 'neologix', 'python-dev', 'zach.ware', 'lambertv']
pr_nums = []
priority = 'low'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue18948'
versions = ['Python 3.4']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
easytestsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Activity
pitrou commentedon Sep 6, 2013
Here is a (exhaustive?) list of tests which deliberately crash the interpreter:
They should reuse the new SuppressCoreFiles facility from test.support.
lambertv commentedon Sep 13, 2013
Great! Thanks for putting together a list. I've incorporated SuppressCoreFiles into these tests and have used the test suite without any errors. Again, I'm testing these on Ubuntu.
pitrou commentedon Sep 13, 2013
Ok, I've left a comment on the review tool above. You can click on the "review" link if you haven't received an e-mail.
lambertv commentedon Sep 14, 2013
Oops! That was careless. Fixed.
zware commentedon Sep 16, 2013
Perhaps it would be best to either combine SuppressCoreFiles and suppress_crash_popup, or provide a new construct that does so since both are used in almost every place one is used. Also, test_daemon_threads_fatal_error in test_threading should be using suppress_crash_popup, but isn't currently, which I believe falls under the scope of this issue.
vstinner commentedon Oct 1, 2013
Yes, these two tools must be merged into one unique portable tool. Example of names:
Doc: "On Windows, don't display the Windows Error Reporting dialog. On UNIX, disable the creation of coredump file."
vstinner commentedon Oct 1, 2013
test.support.SuppressCoreFiles was added by bpo-18623.
I implemented a similar tool in my tracemalloc fork:
http://hg.python.org/features/tracemalloc/rev/b91450e51388
zware commentedon Oct 7, 2013
Here's a patch that combines Valerie's patch with a merged suppress_crash_popup and SuppressCoreFiles called SuppressCrashReport.
Tests ok on Windows; I haven't been able to test on Unix yet.
pitrou commentedon Oct 7, 2013
Thanks! The patch works fine here under Linux, too (though I haven't tried to figure out if it really prevented core files from being generated).
python-dev commentedon Oct 8, 2013
New changeset 1cbd3d9f7d61 by Antoine Pitrou in branch 'default':
Issue bpo-18948: improve SuppressCoreFiles to include Windows crash popup suppression, and use it in more tests.
http://hg.python.org/cpython/rev/1cbd3d9f7d61
pitrou commentedon Oct 8, 2013
Patch committed. Thanks to both of you!