You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@vmoo.com> on 2008/10/12 15:43:43 UTC

Errors in test framework cleanup

	Hi Julian,

I see you are more into coding python and the test framework than I do. 

If you have some time, could you please look at why the test cleanup code
(as enabled when passing -c from win-tests.py) fails, this shows as a failed
test?

I saw several instances of this problem when I ran the tests on the 1.5.3
release (svnserve and apache blocked access to the repository for some time
after the tests completed). It would be much easier if these errors would
have another classification than 'test failed'.

Thanks,
	Bert


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Errors in test framework cleanup

Posted by "D.J. Heap" <dj...@gmail.com>.
On Sun, Oct 12, 2008 at 10:09 AM, Julian Foad
<ju...@btopenworld.com> wrote:
> Bert Huijben wrote:
>> If you have some time, could you please look at why the test cleanup code
>> (as enabled when passing -c from win-tests.py) fails, this shows as a failed
>> test?
>
> Hi Bert. I don't have Windows, but if you show me/us exactly what goes
> wrong, I/we might be able to help. I don't exactly have spare time, but
> I could always make time for a quick look.


I have seen these occasionally, but only when testing the BDB backend
and usually only with Apache.  The last time I got them (1.5.2 I think
since I didn't see them when running tests for 1.5.3) I looked at this
a little bit and couldn't see where it would be a
permissions/read-only problem or a tag-alongs-holding-files problem
because it looked like we were using safe_rmtree where appropriate.

I suspected maybe a BDB handle (or whatever they are) being left open
(maybe for caching purposes or maybe just a leak), but that's just a
guess.  Is it always BDB repositories that fail to cleanup for others?
 I'm fairly certain it always has been for me.

DJ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Errors in test framework cleanup

Posted by Julian Foad <ju...@btopenworld.com>.
Bert Huijben wrote:
> If you have some time, could you please look at why the test cleanup code
> (as enabled when passing -c from win-tests.py) fails, this shows as a failed
> test?

Hi Bert. I don't have Windows, but if you show me/us exactly what goes
wrong, I/we might be able to help. I don't exactly have spare time, but
I could always make time for a quick look.

Is this mail thread describing the problem you see?
<http://svn.haxx.se/users/archive-2007-01/0022.shtml> In that thread,
David James ends by saying the problems should be fixed.

I guess if there's still a problem with clean-up, it must be in
safe_rmtree() in subversion/tests/cmdline/svntest/main.py:

[[[
# Chmod recursively on a whole subtree
def chmod_tree(path, mode, mask):
  def visit(arg, dirname, names):
    mode, mask = arg
    for name in names:
      fullname = os.path.join(dirname, name)
      if not os.path.islink(fullname):
        new_mode = (os.stat(fullname)[stat.ST_MODE] & ~mask) | mode
        os.chmod(fullname, new_mode)
  os.path.walk(path, visit, (mode, mask))

# For clearing away working copies
def safe_rmtree(dirname, retry=0):
  "Remove the tree at DIRNAME, making it writable first"
  def rmtree(dirname):
    chmod_tree(dirname, 0666, 0666)
    shutil.rmtree(dirname)

  if not os.path.exists(dirname):
    return

  if retry:
    for delay in (0.5, 1, 2, 4):
      try:
        rmtree(dirname)
        break
      except:
        time.sleep(delay)
    else:
      rmtree(dirname)
  else:
    rmtree(dirname)
]]]

This looks fairly Unix-specific, and I don't know if it is intended to
work on Windows too. The mail thread above indicated that
"shutil.rmtree" should not be used on Windows.

- Julian



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org