This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [2.7] regrtest: handle child process crash
Type: Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2017-05-03 14:25 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1431 merged vstinner, 2017-05-03 14:29
PR 1477 merged vstinner, 2017-05-05 08:22
PR 1479 merged vstinner, 2017-05-05 09:56
PR 2244 merged vstinner, 2017-06-16 11:35
Messages (12)
msg292904 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-03 14:25
In the master branch, regrtest in multiprocess mode handles well crash of child processes. In 2.7, regrtest handles them badly: see issue #30254.

Attached PR backports the CHILD_ERROR status from regrtest master and adds code to handle crash (or any non-zero exit code) of the child process (a worker running an unit test).
msg292906 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-03 15:07
Victor, you are just incredible!
msg292907 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-03 15:28
New changeset c991eb280e60ed25c68a5332bd8633959e9f7113 by Victor Stinner in branch '2.7':
bpo-30258: regrtest handles child process crash (#1431)
https://github.com/python/cpython/commit/c991eb280e60ed25c68a5332bd8633959e9f7113
msg292911 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-03 16:05
Ooops, there is a bug in my pushed changed, spotted by Serhiy:

>                      # Strip last refcount output line if it exists, since it
                     # comes from the shutdown of the interpreter in the subcommand.
                     stderr = debug_output_pat.sub("", stderr)
+
+                    if retcode != 0:
+                        result = (CHILD_ERROR, "Exit code %s" % retcode)
+                        output.put((test, stdout.rstrip(), stderr.rstrip(),
+                                    result))
+

Missed return?
msg293078 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-05 08:28
New changeset 228da42961ac9bf2990e6c191ecc9b762ead617c by Victor Stinner in branch '2.7':
bpo-30258: Fix handling of child error in regrtest (#1477)
https://github.com/python/cpython/commit/228da42961ac9bf2990e6c191ecc9b762ead617c
msg293079 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-05 08:29
@Serhiy: I fixed the bug you found. Don't hesitate to propose directly a PR if I missed something (or open an issue, it's up to you).

At least, regrtest of Python 2.7 should now handle correctly crashes when using -jN.
msg293085 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-05 09:38
You just pressed the merge button 2 minutes before I finished a review.
msg293086 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-05 09:40
Do you mind to port changes to 3.x?
msg293089 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-05 09:56
> You just pressed the merge button 2 minutes before I finished a review.

Oh sorry, I didn't expect a review on this small change.

> Do you mind to port changes to 3.x?

I created https://github.com/python/cpython/pull/1479 for the run_tests_multiprocess() bugfix.
msg293296 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-09 09:34
New changeset 74683fc6247c522ae955a6e7308b8ff51def35d8 by Victor Stinner in branch 'master':
bpo-30258: regrtest: Fix run_tests_multiprocess() (#1479)
https://github.com/python/cpython/commit/74683fc6247c522ae955a6e7308b8ff51def35d8
msg293829 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 00:27
Python 2.7 now has test_regrtest and test_regrtest pass on all 2.7 buildbots, so I close the issue.
msg296190 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-16 12:39
New changeset a0ccc54e6dffacf9e7c06f2a3e9056d2d35d21eb by Victor Stinner in branch '3.6':
Synchronize libregrtest from master to 3.6 (#2244)
https://github.com/python/cpython/commit/a0ccc54e6dffacf9e7c06f2a3e9056d2d35d21eb
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74444
2017-06-16 12:39:12vstinnersetmessages: + msg296190
2017-06-16 11:35:58vstinnersetpull_requests: + pull_request2291
2017-05-17 00:27:05vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg293829
2017-05-09 09:34:05vstinnersetmessages: + msg293296
2017-05-05 09:57:03vstinnersetstatus: closed -> open
resolution: fixed -> (no value)
2017-05-05 09:56:57vstinnersetmessages: + msg293089
2017-05-05 09:56:16vstinnersetpull_requests: + pull_request1578
2017-05-05 09:40:41serhiy.storchakasetmessages: + msg293086
2017-05-05 09:38:30serhiy.storchakasetmessages: + msg293085
2017-05-05 08:29:56vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg293079

stage: resolved
2017-05-05 08:28:37vstinnersetmessages: + msg293078
2017-05-05 08:22:25vstinnersetpull_requests: + pull_request1576
2017-05-03 16:05:48vstinnersetmessages: + msg292911
2017-05-03 15:28:31vstinnersetmessages: + msg292907
2017-05-03 15:07:55serhiy.storchakasetmessages: + msg292906
2017-05-03 14:29:27vstinnersetpull_requests: + pull_request1536
2017-05-03 14:25:28vstinnercreate