This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients barry, maxking, r.david.murray, serhiy.storchaka, vstinner, xtreak
Date 2020-01-09.10:25:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1578565509.48.0.553385629885.issue39029@roundup.psfhosted.org>
In-reply-to
Content
> yes, the test uses support.TESTFN which has the value of "{}_{}_tmp".format(TESTFN, os.getpid()) in the setUp [0] to create tempdir. Under parallel tests the pid value of TESTFN is initialised with a pid once and used always in the setup calls. So setup acts under parallel tests with same test folder. The tempdir can be dynamically generated but I guess this pattern to use support.TESTFN is common and there could be other flaky tests.

I don't understand. Let's say that test_mailbox and test_os are run in parallel, process 1 runs test_mailbox and process 2 runs test_os. TESTFN should be different in each process but globally unique.

So I don't understand the difference between:

-        self._path = support.TESTFN

and:

+        self._tempdir = tempfile.TemporaryDirectory()
+        self._path = self._tempdir.name

Is it because the test currently doesn't remove self._path directory in some cases?

You wrote "I guess the file is not really deleted in some cases." I think that this should be investigated first.
History
Date User Action Args
2020-01-09 10:25:09vstinnersetrecipients: + vstinner, barry, r.david.murray, serhiy.storchaka, maxking, xtreak
2020-01-09 10:25:09vstinnersetmessageid: <1578565509.48.0.553385629885.issue39029@roundup.psfhosted.org>
2020-01-09 10:25:09vstinnerlinkissue39029 messages
2020-01-09 10:25:09vstinnercreate