[Python-Dev] Tests failing on Windows with TESTFN (original) (raw)
Chris Jerdonek chris.jerdonek at gmail.com
Fri Jul 27 01:25:43 EDT 2018
- Previous message (by thread): [Python-Dev] Tests failing on Windows with TESTFN
- Next message (by thread): [Python-Dev] Tests failing on Windows with TESTFN
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Jul 25, 2018 at 8:07 AM, Tim Golden <mail at timgolden.me.uk> wrote:
One problem is that certain tests use support.TESTFN (a local directory constructed from the pid) for output files etc. However this can cause issues on Windows when recreating the folders / files for multiple tests, especially when running in parallel.
Here's an example on my laptop deliberately running 3 tests with -j0 which I know will generate an error about one time in three: C:\work-in-progress\cpython>python -mtest -j0 testurllib2 testbz2 testimportlib Running Debug|Win32 interpreter... Run tests in parallel using 6 child processes 0:00:23 [1/3/1] testurllib2 failed test testurllib2 failed -- Traceback (most recent call last): File "C:\work-in-progress\cpython\lib\test\testurllib2.py", line 821, in testfile f = open(TESTFN, "wb") PermissionError: [Errno 13] Permission denied: '@test15564tmp' Although these errors are both intermittent and fairly easily spotted, the effect is that I rarely get a clean test run when I'm applying a patch. I started to address this years ago but things stalled. I'm happy to pick this up again and have another go, but I wanted to ask first whether there was any objection to my converting tests to using tempfile functions which should avoid the problem?
Do you know what's causing the issue on Windows? I thought TESTFN was designed to work for parallel testing, so it would surprise me if there was a problem with it. Alternatively, if TESTFN should be okay, I wonder if it's an issue with another test or tests not cleaning up after itself correctly, in which case it seems like this is an opportunity to track down and fix that issue. Switching to something else would just serve to hide / mask the issue with those other tests.
--Chris
- Previous message (by thread): [Python-Dev] Tests failing on Windows with TESTFN
- Next message (by thread): [Python-Dev] Tests failing on Windows with TESTFN
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]