gh-154137: Check for Windows handle leaks in regrtest - #154140
Conversation
Add handle_count() to test.support.os_helper.
|
I found a leak when running tests on Windows using
I can reproduce at least one of these leaks by running |
|
test_socket leaks 1 handle: |
|
TODO: Update |
I cannot identify the leaking test by running |
|
!buildbot AMD64 Windows11 Refleaks PR |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit 37c29f3 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F154140%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
Ah, test_pathlib fails on Windows. I will fix later. First, I'm waiting for Windows11 Refleaks buildbot report. |
|
Oh, it seems like
|
|
Aaaand last but not least:
|
Reuse os_helper.handle_count() in test_os.test_windows.
|
!buildbot AMD64 Windows11 Refleaks PR |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit e66fb14 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F154140%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Done.
Fixed by PR gh-154201.
I created issue gh-154208 to investigate this leak. |
Oh, test_launcher also leaked. I didn't notice this one before. |
|
I'm unable to reproduce this leak. But this test has just been removed in the main branch by commit bd31583! So I will just update this branch instead. |
|
I extracted the changes adding os_helper.fd_count() in the new PR gh-157637 to make this PR smaller. |
|
I modified the PR to skip check on handle count when running multiprocessing and concurrent.futures tests to work around the issue gh-154208. While there are other tests which use multiprocessing, only multiprocessing tests stop the pool before child processes have time to steal the handles from the parent process. It's a compromise to check for handle leaks for all other tests. |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit 53f6c75 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F154140%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
""buildbot/ARM64 Windows Non-Debug PR" failed to build Python with "compiler is out of heap space in pass 2" error. The buildbot also fails on the main branch, so it's unrelated: https://buildbot.python.org/#/builders/730/builds/14595 |
Add handle_count() to test.support.os_helper.