New submission from Jeremy Kloth:

Currently, removing directories during testing on Windows w/NTFS can causing 
sporadic failures due to access denied errors.  This is caused by other 
processes getting a handle to the directory itself (change notifications) or a 
handle to a file within the directory.  The most notable offender is the 
Indexing Service.

Most (but not all!) external programs can be configured to ignore the 
development directory.  For example, the Indexing Service can be disabled or 
have those directories ignored.  TortoiseSVN is another offender that can 
exclude directories but each directory needs to be listed separately so it is 
easy to forgot one.  On my machine I have programs that simply do not have an 
option to ignore any directories thus causing some grief during testing.

The attached patch to test.support eliminates the need to disable or and 
ignores to any programs (tested on a Win7-x64 i7-3770K@4.3GHz).

It achieves this by checking for the removal of the directory before returning 
to the caller.  It performs an exponential backoff timeout loop that amounts to 
a total of ~1 second in the worst case.  If the directory is not removed from 
the filesystem by then, it will probably be in error anyway.  However, the loop 
is seldom executed more than once.

----------
components: Tests
files: support.diff
keywords: patch
messages: 166853
nosy: jkloth
priority: normal
severity: normal
status: open
title: harden directory removal for tests on Windows
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file26590/support.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15496>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to