Skip to content

ResourceWarning messages being printed #320

Description

@manoelmarques

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions