|
msg346692 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-06-26 22:34 |
When running tests, the tempoary directory is not left clean: there are temporary files which are not removed.
I wrote a PoC change to detect such bugs and I found that at least test_shutil and test_urllib leak such temporary files/directories.
|
|
msg346693 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-06-26 22:39 |
Test leaking a temporary file in test_urllib:
test.test_urllib.urlretrieve_HttpTests.test_short_content_raises_ContentTooShortError_without_reporthook
I'm not sure of my fix:
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index f6ce9cb6d5..fdddd6e2d8 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -283,6 +283,7 @@ def urlretrieve(url, filename=None, reporthook=None, data=None):
reporthook(blocknum, bs, size)
if size >= 0 and read < size:
+ urlcleanup()
raise ContentTooShortError(
"retrieval incomplete: got only %i out of %i bytes"
% (read, size), result)
|
|
msg346699 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-06-26 23:39 |
Using PR 14415, the following test of test_multiprocessing_spawn emits a false alarm because multiprocessing use "Finalizer" objects which are only finalized "later":
test.test_multiprocessing_spawn.WithManagerTestMyManager.test_mymanager_context_prestarted
Workaround, call explicitly _run_finalizers():
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index eef262d723..bfecbab9ee 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -5651,6 +5651,7 @@ def install_tests_in_module_dict(remote_globs, start_method):
if need_sleep:
time.sleep(0.5)
multiprocessing.process._cleanup()
+ multiprocessing.util._run_finalizers()
test.support.gc_collect()
remote_globs['setUpModule'] = setUpModule
|
|
msg346700 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-06-26 23:40 |
New changeset 4c26abd14f1b7242998eb2f7756aa375e0fe714f by Victor Stinner in branch 'master':
bpo-37421: Fix test_shutil: don't leak temporary files (GH-14416)
https://github.com/python/cpython/commit/4c26abd14f1b7242998eb2f7756aa375e0fe714f
|
|
msg346703 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-06-26 23:57 |
New changeset 7fe81ce47ff6725e2e4d667d499e23dac19834af by Miss Islington (bot) in branch '3.8':
bpo-37421: Fix test_shutil: don't leak temporary files (GH-14416)
https://github.com/python/cpython/commit/7fe81ce47ff6725e2e4d667d499e23dac19834af
|
|
msg347127 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-02 10:37 |
About urllib.request, I created: bpo-37475 "What is urllib.request.urlcleanup() function?".
|
|
msg347135 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-02 11:32 |
New changeset 039fb49c185570ab7b02f13fbdc51c859cfd831e by Victor Stinner in branch 'master':
bpo-37421: multiprocessing tests call _run_finalizers() (GH-14527)
https://github.com/python/cpython/commit/039fb49c185570ab7b02f13fbdc51c859cfd831e
|
|
msg347137 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-07-02 11:58 |
New changeset 632cb36084dc9d13f1cdb31a0e7e3ba80745a51a by Miss Islington (bot) in branch '3.8':
bpo-37421: multiprocessing tests call _run_finalizers() (GH-14527)
https://github.com/python/cpython/commit/632cb36084dc9d13f1cdb31a0e7e3ba80745a51a
|
|
msg347140 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-02 12:50 |
New changeset 7cb9204ee1cf204f6f507d99a60f7c5bb359eebb by Victor Stinner in branch 'master':
bpo-37421: urllib.request tests call urlcleanup() (GH-14529)
https://github.com/python/cpython/commit/7cb9204ee1cf204f6f507d99a60f7c5bb359eebb
|
|
msg347191 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-03 09:10 |
New changeset b71d8d67959f3b5efbdfe00066589ac0d8f98aad by Victor Stinner in branch 'master':
bpo-37421: test_winconsoleio doesn't leak temp file anymore (GH-14562)
https://github.com/python/cpython/commit/b71d8d67959f3b5efbdfe00066589ac0d8f98aad
|
|
msg347192 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-03 09:10 |
New changeset 684cb47fffb7af3ac50cb077f6d2a095c9ce20b4 by Victor Stinner in branch 'master':
bpo-37421: test_concurrent_futures cleans up multiprocessing (GH-14563)
https://github.com/python/cpython/commit/684cb47fffb7af3ac50cb077f6d2a095c9ce20b4
|
|
msg347193 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-03 09:12 |
New changeset 74c9dd57771f4f061ee83b069c8e7b37de41246b by Victor Stinner in branch 'master':
bpo-37421: Fix test_distutils.test_build_ext() (GH-14564)
https://github.com/python/cpython/commit/74c9dd57771f4f061ee83b069c8e7b37de41246b
|
|
msg347199 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-07-03 09:31 |
New changeset a2a807f75dc162dfb45fb297aee4961de8008f84 by Miss Islington (bot) in branch '3.8':
bpo-37421: test_winconsoleio doesn't leak temp file anymore (GH-14562)
https://github.com/python/cpython/commit/a2a807f75dc162dfb45fb297aee4961de8008f84
|
|
msg347201 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-07-03 09:36 |
New changeset 79665c698fb8f97475e03c4231067db1ae47addb by Miss Islington (bot) in branch '3.8':
bpo-37421: test_concurrent_futures cleans up multiprocessing (GH-14563)
https://github.com/python/cpython/commit/79665c698fb8f97475e03c4231067db1ae47addb
|
|
msg347204 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-07-03 09:48 |
New changeset 0aefba7f99f0fd9bcb3328a5919e07f9e03676b0 by Miss Islington (bot) in branch '3.8':
bpo-37421: Fix test_distutils.test_build_ext() (GH-14564)
https://github.com/python/cpython/commit/0aefba7f99f0fd9bcb3328a5919e07f9e03676b0
|
|
msg347265 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-04 10:29 |
New changeset 9d40554e0da09a44a8547f3f3a2b9dedfeaf7928 by Victor Stinner in branch 'master':
bpo-37421: Fix multiprocessing get_temp_dir() finalizer (GH-14572)
https://github.com/python/cpython/commit/9d40554e0da09a44a8547f3f3a2b9dedfeaf7928
|
|
msg347270 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-07-04 10:46 |
New changeset 2d438fc0b748b64d518ea8876af3f6963c6d7d60 by Miss Islington (bot) in branch '3.7':
bpo-37421: Fix multiprocessing get_temp_dir() finalizer (GH-14572)
https://github.com/python/cpython/commit/2d438fc0b748b64d518ea8876af3f6963c6d7d60
|
|
msg347273 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-07-04 11:34 |
New changeset 957656ee1d6fb42664274ef2f440a10d26870e2a by Miss Islington (bot) in branch '3.8':
bpo-37421: Fix multiprocessing get_temp_dir() finalizer (GH-14572)
https://github.com/python/cpython/commit/957656ee1d6fb42664274ef2f440a10d26870e2a
|
|
msg347343 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-05 13:14 |
./python -u -m test test_multiprocessing_spawn -R 3:3 still fail:
ERROR: test_context (test.test_multiprocessing_spawn.TestStartMethod)
ERROR: test_set_get (test.test_multiprocessing_spawn.TestStartMethod)
PR 14601 fix these tests when test_multiprocessing_spawn is run more than once.
|
|
msg347348 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-05 14:16 |
New changeset 8fbeb14312b4c1320d31ad86e69749515879d1c3 by Victor Stinner in branch 'master':
bpo-37421: multiprocessing tests now stop ForkServer (GH-14601)
https://github.com/python/cpython/commit/8fbeb14312b4c1320d31ad86e69749515879d1c3
|
|
msg347352 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-05 14:22 |
I created a follow-up issue: bpo-37507 "multiprocessing: Add a stop() method to ForkServer".
|
|
msg347355 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-07-05 14:35 |
New changeset 229f6e85f8b4d57a2e742e0d3fc361c5bd15f1cb by Miss Islington (bot) in branch '3.8':
bpo-37421: multiprocessing tests now stop ForkServer (GH-14601)
https://github.com/python/cpython/commit/229f6e85f8b4d57a2e742e0d3fc361c5bd15f1cb
|
|
msg347492 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-08 08:49 |
New changeset e676244235895aeb6ec3b81ca3ccf4a70e487919 by Victor Stinner in branch 'master':
bpo-37421: test_concurrent_futures stops ForkServer (GH-14643)
https://github.com/python/cpython/commit/e676244235895aeb6ec3b81ca3ccf4a70e487919
|
|
msg347493 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-08 09:52 |
New changeset cdada40b23b1f7f527797ba7cb14c25820b05981 by Victor Stinner (Miss Islington (bot)) in branch '3.8':
bpo-37421: test_concurrent_futures stops ForkServer (GH-14643) (GH-14645)
https://github.com/python/cpython/commit/cdada40b23b1f7f527797ba7cb14c25820b05981
|
|
msg347513 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-07-08 22:10 |
It seems like tests don't leak temporary files anymore:
$ mkdir ~/TEMP
$ TMPDIR=~/TEMP TEMPDIR=~/TEMP ./python -m test -v -r -u all,-gui
$ ls ~/TEMP
# empty directory
I close the issue.
|
|
msg367157 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2020-04-23 22:44 |
New changeset fd32a0e2ee445dd7156323d216627112e66b0a69 by Victor Stinner in branch '3.7':
[3.7] bpo-38546: Backport multiprocessing tests fixes from master (GH-19689)
https://github.com/python/cpython/commit/fd32a0e2ee445dd7156323d216627112e66b0a69
|