python / cpython

The Python programming language
https://www.python.org
Other
62.94k stars 30.14k forks source link

``test_asyncio.test_server`` raises a ``ResourceWarning`` #113879

Closed Eclips4 closed 9 months ago

Eclips4 commented 9 months ago

Bug report

Bug description:

./python -m test -v test_asyncio.test_server
== CPython 3.13.0a2+ (heads/main:a9df076d7d, Jan 8 2024, 21:28:03) [GCC 9.4.0]
== Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.31 little-endian
== Python build: debug
== cwd: /home/eclips4/CLionProjects/cpython/build/test_python_worker_20604æ
== CPU count: 16
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 711920436
0:00:00 load avg: 0.21 Run 1 test sequentially
0:00:00 load avg: 0.21 [1/1] test_asyncio.test_server
test_start_server_1 (test.test_asyncio.test_server.ProactorStartServerTests.test_start_server_1) ... skipped 'Windows only'
test_start_server_1 (test.test_asyncio.test_server.SelectorStartServerTests.test_start_server_1) ... ok
test_start_unix_server_1 (test.test_asyncio.test_server.SelectorStartServerTests.test_start_unix_server_1) ... ok
test_wait_closed_basic (test.test_asyncio.test_server.TestServer2.test_wait_closed_basic) ... ok
test_wait_closed_race (test.test_asyncio.test_server.TestServer2.test_wait_closed_race) ... ok
test_unix_server_addr_cleanup (test.test_asyncio.test_server.UnixServerCleanupTests.test_unix_server_addr_cleanup) ... ok
test_unix_server_cleanup_gone (test.test_asyncio.test_server.UnixServerCleanupTests.test_unix_server_cleanup_gone) ... ok
test_unix_server_cleanup_prevented (test.test_asyncio.test_server.UnixServerCleanupTests.test_unix_server_cleanup_prevented) ... o
k
test_unix_server_cleanup_replaced (test.test_asyncio.test_server.UnixServerCleanupTests.test_unix_server_cleanup_replaced) ... /ho
me/eclips4/CLionProjects/cpython/Lib/asyncio/events.py:84: ResourceWarning: unclosed <socket.socket fd=7, family=1, type=1, proto=
0, laddr=./test_python_gustheh6.sock>
  self._context.run(self._callback, *self._args)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
ok
test_unix_server_sock_cleanup (test.test_asyncio.test_server.UnixServerCleanupTests.test_unix_server_sock_cleanup) ... ok

----------------------------------------------------------------------
Ran 9 tests in 0.243s

OK (skipped=1)

== Tests result: SUCCESS ==

1 test OK.

Total duration: 389 ms
Total tests: run=9 skipped=1
Total test files: run=1/1
Result: SUCCESS

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

serhiy-storchaka commented 9 months ago

I just searched if there is an already open issue for my fix.