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: Resource warnings in test_subprocess
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: giampaolo.rodola, gregory.p.smith, xtreak
Priority: normal Keywords: patch

Created on 2021-04-13 05:28 by xtreak, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25381 merged xtreak, 2021-04-13 05:31
Messages (2)
msg390924 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2021-04-13 05:28
It seems that some of the pipe objects were not closed properly causing resource warnings. Regarding "subprocess still running warning" I guess we need to call kill() on the subprocess before exiting test_send_signal_race2. I will raise a PR for this.

➜  cpython git:(master) ./python -X dev -Wall -m test test_subprocess                       
0:00:00 load avg: 0.06 Run tests sequentially
0:00:00 load avg: 0.06 [1/1] test_subprocess
/root/cpython/Lib/subprocess.py:1066: ResourceWarning: subprocess 22107 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback

== Tests result: SUCCESS ==

1 test OK.

Total duration: 28.9 sec
Tests result: SUCCESS
msg400203 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2021-08-24 10:44
New changeset 7179930ab5f5b2dea039023bec968aadc03e3775 by Karthikeyan Singaravelan in branch 'main':
bpo-43826: Fix resource warning due to unclosed objects. (GH-25381)
https://github.com/python/cpython/commit/7179930ab5f5b2dea039023bec968aadc03e3775
History
Date User Action Args
2022-04-11 14:59:44adminsetgithub: 87992
2021-08-24 12:36:28xtreaksetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.11, - Python 3.10
2021-08-24 10:44:18xtreaksetmessages: + msg400203
2021-08-24 08:33:07serhiy.storchakalinkissue43598 superseder
2021-04-13 05:31:26xtreaksetkeywords: + patch
stage: patch review
pull_requests: + pull_request24113
2021-04-13 05:28:53xtreakcreate