transient error in selftest suite

John A Meinel john at arbash-meinel.com
Sat Dec 24 19:16:29 GMT 2005


Denys Duchier wrote:
> This is very odd - I occasionally get the following error when running
> the selftest suite:
> 
> ======================================================================
> FAIL: errors (bzrlib)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/python2.4/doctest.py", line 2152, in runTest
>     raise self.failureException(self.format_failure(new.getvalue()))
> AssertionError: Failed doctest test for bzrlib.errors
>   File "/mnt/kubuntu/home/duchier/src/bzr.merge/bzrlib/errors.py", line 16, in errors
> 
> ----------------------------------------------------------------------
> File "/mnt/kubuntu/home/duchier/src/bzr.merge/bzrlib/errors.py", line 32, in bzrlib.errors
> Failed example:
>     try:
>       raise NotBranchError(path='/foo/bar')
>     except:
>       print sys.exc_type
>       print sys.exc_value
>       print sys.exc_value.path
> Exception raised:
>     Traceback (most recent call last):
>       File "/usr/lib/python2.4/doctest.py", line 1243, in __run
>         compileflags, 1) in test.globs
>       File "<doctest bzrlib.errors[1]>", line 6, in ?
>         print sys.exc_value.path
>     AttributeError: timeout instance has no attribute 'path'
> 
> 
> ----------------------------------------------------------------------
> Ran 578 tests in 54.793s
> 
> FAILED (failures=1)
> tests failed
> 
> --Denys
> 

Are you running on Windows, and probably cygwin? I was finding some odd 
'timeout' errors. There were definitely some gremlins in the cygwin 
version of bzr. (The win32 is actually running smoother right now).

The problem is that the above test is trying to test that NotBranchError 
has a 'path' attribute. But when it tries to raise NotBranchError, it 
actually gets a cygwin error of 'timeout'. Which doesn't have 'path' so 
you get this really crappy error traceback.
And because timeout is a timing error, it isn't 100% reproduceable, and 
*really* hard to debug.

What I might recommend is try changing the test to:

 >>> try:
...   raise NotBranchError(path='/foo/bar')
... except BzrError:
...   print sys.exc_type
...   print sys.exc_value
...   print sys.exc_value.path
bzrlib.errors.NotBranchError
Not a branch: /foo/bar
/foo/bar

I'm on vacation, so I don't have access to a windows machine right now. 
But basically you want to catch the NotBranchError, but you *don't* want 
to catch just any error.
Then hopefully the timeout will properly throw itself, and give you a 
nice traceback so we can figure out why cygwin python is on crack.

John
=:->




More information about the bazaar mailing list