[Python-Dev] fixing tests on windows

Trent Nelson tnelson at onresolve.com
Fri Apr 4 10:29:16 CEST 2008

I agree with Tim, you can jump through as many hoops as you want (setting directories private, using %TEMP% exclusively, etc), but I doubt anything is going to change the behaviour of things like virus scanners, for example.

Tim, let me know if you need help with anything, perhaps we could set up a temporary branch outside of trunk to play around with various approaches to see what works best.  This'll ensure we don't adversely affect the main buildbots, but also give us the option to get different Windows boxes to build our test branch on demand.


From: python-dev-bounces+tnelson=onresolve.com at python.org [python-dev-bounces+tnelson=onresolve.com at python.org] On Behalf Of Tim Golden [mail at timgolden.me.uk]
Sent: 04 April 2008 04:04
Cc: python-dev at python.org
Subject: Re: [Python-Dev] fixing tests on windows

Terry Reedy wrote:
> If the testdir disallows the search indexer, then there should be no need
> to disable Windows Search Service.  If privatizing the dir kept other
> programs out, then likewise.
> | Or were you suggesting that there is some programmatic way for the
> | test suite to create directories that disallow the Search Service,
> | etc.?
> I suspect, but do not know, that the dialog box effects changes through
> user-programmable interfaces.  So while I would start with manual changes
> to see if that solves the problem, I presume there must be a system call
> for changing dir attributes.

The problem is, I think, that it isn't just the Indexing Service
which generates this issue. TortoiseSVN is well known for doing
the same thing, and there could be now and potentially will be
in the future other programs. I don't think that hunting down
and turning off their interference case by case is a viable
solution in the long-term. Although it would obviously be a
way forward in the short term, _faute de mieux_.

[Tony Nelson]
> I'd think that files and directories created in the TEMP
> directory would normally not be indexed on any OS, including
> MSWindows. But this is just a guess.

I'm inclined to think you're right. And a first pass I had at
producing a solution simply used tempfile to do everything.
Unfortunately that's far more invasive than I was really
comfortable with at the time: at the very least, you have
to patch several tests which fail if there's an (escaped)
backslash in the path.

However, it's clear that my attempt to cause the minimum damage
isn't enough to clear the problem 100%. So I think the next move
is indeed to turn test_support.TESTFN into a function (in some
way) which generates a unique tempfile reference, possibly with
a context manager to clean up. Or something.

The complication is that, while most test simply want a handy
file to exist or be written to, and don't really care what
happens afterwards, some tests are testing the very mechanism
of creating/deleting a file etc. So a wholesale replacement
isn't necessarily straightforward.

On we go.


Python-Dev mailing list
Python-Dev at python.org
Unsubscribe: http://mail.python.org/mailman/options/python-dev/tnelson%40onresolve.com

More information about the Python-Dev mailing list