stestr icon indicating copy to clipboard operation
stestr copied to clipboard

ResourceWarning messages being printed

Open manoelmarques opened this issue 2 years ago • 1 comments

Issue description When PYTHONWARNINGS is set to default, stestr prints ResourceWarning messages for files not closed and subprocesses still running.

Expected behavior and actual behavior

It shouldn't print the messages as they are sometimes interfering with the Totals report.

Steps to reproduce the problem

Run stestr with PYTHONWARNINGS env. set to default

Specifications like the version of the project, operating system, or hardware

System information

  • OS: [Ubuntu 20.04.4, macOS 11.6.4, Windows Server 2019]
  • stestr version (3.2.1):
  • Python release (3.7,3.8,3.9,3.10):
  • pip packages (pip freeze):

Additional information

sys:1: ResourceWarning: unclosed file <_io.FileIO name=1 mode='wb' closefd=True>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/site-packages/stestr/commands/load.py:287: ResourceWarning: unclosed file <_io.FileIO name=6 mode='rb' closefd=True>
  case.run(result)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 4002 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 4000 is still running

======
  _warn("subprocess %s is still running" % self.pid,
Totals
ResourceWarning: Enable tracemalloc to get the object allocation traceback
======
Ran: 452 tests in 694.6567 sec.
 - Passed: 452
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 0
Sum of execute time for each test: 1237.7825 sec.

==============
Worker Balance
==============
 - Worker 0 (226 tests) => 0:09:03.602362
 - Worker 1 (226 tests) => 0:11:34.656738

manoelmarques avatar Mar 08 '22 15:03 manoelmarques

I think there are still other warnings being emitted (I think around open fds) so I reopened this but #322 should have fixed a bunch of the warnings

mtreinish avatar Apr 15 '22 13:04 mtreinish