STINNER Victor <vstin...@python.org> added the comment:
> 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39029> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com