[tahoe-dev] [tahoe-lafs] #749: Tahoe-LAFS fails unit tests when the "-OO" flag is passed to Python to optimize and strip docstrings

tahoe-lafs trac at allmydata.org
Mon Jul 6 19:39:49 PDT 2009


#749: Tahoe-LAFS fails unit tests when the "-OO" flag is passed to Python to
optimize and strip docstrings
--------------------+-------------------------------------------------------
 Reporter:  zooko   |           Owner:  somebody
     Type:  defect  |          Status:  new     
 Priority:  major   |       Milestone:  1.5.0   
Component:  code    |         Version:  1.4.1   
 Keywords:          |   Launchpad_bug:          
--------------------+-------------------------------------------------------
 These six unit tests fail if optimization is turned on:

 {{{
 $ PYTHONOPTIMIZE=2 PYTHONPATH=./support/lib/python2.6/site-packages/ trial
 allmydata.test.test_mutable.Roundtrip.test_corrupt_all_verbyte
 allmydata.test.test_uri.Constraint.test_constraint
 allmydata.test.test_web.Web.test_GET_unhandled_URI
 allmydata.test.test_web.Web.test_GET_unhandled_URI_named
 allmydata.test.test_web.Web.test_GET_unhandled_URI
 allmydata.test.test_web.Web.test_GET_unhandled_URI_named
 allmydata.test.test_mutable.Roundtrip.test_corrupt_all_verbyte
 allmydata.test.test_uri.Constraint.test_constraint
 allmydata.test.test_web.Web.test_GET_unhandled_URI
 allmydata.test.test_web.Web.test_GET_unhandled_URI_named
 allmydata.test.test_web.Web.test_GET_unhandled_URI
 allmydata.test.test_web.Web.test_GET_unhandled_URI_named
 }}}
 ...
 {{{
 allmydata.test.test_uri
   Constraint
     test_constraint ...
 [FAIL]
 allmydata.test.test_mutable
   Roundtrip
     test_corrupt_all_verbyte ...
 [FAIL]
 allmydata.test.test_web
   Web
     test_GET_unhandled_URI ...
 [FAIL]
                                          [ERROR]
     test_GET_unhandled_URI_named ...
 [FAIL]
                                    [ERROR]

 ===============================================================================
 [FAIL]: allmydata.test.test_uri.Constraint.test_constraint

 Traceback (most recent call last):
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/test/test_uri.py",
 line 189, in test_constraint
     self.failUnlessRaises(AssertionError,
 uri.NewDirectoryURI.init_from_string, good)
 twisted.trial.unittest.FailTest: <type 'exceptions.AttributeError'> raised
 instead of AssertionError:
  Traceback (most recent call last):
   File "/usr/local/lib/python2.6/dist-
 packages/Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/trial/unittest.py",
 line 752, in _run
     self.getSuppress(), method)
   File "/usr/local/lib/python2.6/dist-
 packages/Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py",
 line 106, in maybeDeferred
     result = f(*args, **kw)
   File "/usr/local/lib/python2.6/dist-
 packages/Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/internet/utils.py",
 line 191, in runWithWarningsSuppressed
     result = f(*a, **kw)
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/test/test_uri.py",
 line 189, in test_constraint
     self.failUnlessRaises(AssertionError,
 uri.NewDirectoryURI.init_from_string, good)
 --- <exception caught here> ---
   File "/usr/local/lib/python2.6/dist-
 packages/Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/trial/unittest.py",
 line 235, in failUnlessRaises
     result = f(*args, **kwargs)
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/uri.py",
 line 337, in init_from_string
     bits = uri[mo.end():]
 exceptions.AttributeError: 'NoneType' object has no attribute 'end'

 ===============================================================================
 [FAIL]: allmydata.test.test_mutable.Roundtrip.test_corrupt_all_verbyte

 Traceback (most recent call last):
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/test/test_mutable.py",
 line 1033, in _do_retrieve
     self.failUnless(substring in "".join(allproblems))
 twisted.trial.unittest.FailTest: None
 ===============================================================================
 [FAIL]: allmydata.test.test_web.Web.test_GET_unhandled_URI

 Traceback (most recent call last):
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/test/test_web.py",
 line 341, in done
     % (which, substring, str(res)))
 twisted.trial.unittest.FailTest: test_GET_unhandled_URI: substring '400
 Bad Request' not in '[Failure instance: Traceback (failure with no
 frames): <class 'twisted.web.error.Error'>: 500 Internal Server Error
 ]'
 ===============================================================================
 [FAIL]: allmydata.test.test_web.Web.test_GET_unhandled_URI_named

 Traceback (most recent call last):
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/test/test_web.py",
 line 341, in done
     % (which, substring, str(res)))
 twisted.trial.unittest.FailTest: GET_unhandled_URI_named: substring '400
 Bad Request' not in '[Failure instance: Traceback (failure with no
 frames): <class 'twisted.web.error.Error'>: 500 Internal Server Error
 ]'
 ===============================================================================
 [ERROR]: allmydata.test.test_web.Web.test_GET_unhandled_URI

 Traceback (most recent call last):
   File "/usr/local/lib/python2.6/dist-
 packages/Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py",
 line 106, in maybeDeferred
     result = f(*args, **kw)
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/web/common.py",
 line 220, in renderHTTP
     return m(ctx)
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/web/filenode.py",
 line 181, in render_GET
     if self.node.is_mutable():
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/test/common.py",
 line 183, in is_mutable
     return self.my_uri.is_mutable()
 exceptions.AttributeError: CHKFileVerifierURI instance has no attribute
 'is_mutable'
 ===============================================================================
 [ERROR]: allmydata.test.test_web.Web.test_GET_unhandled_URI_named

 Traceback (most recent call last):
   File "/usr/local/lib/python2.6/dist-
 packages/Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py",
 line 106, in maybeDeferred
     result = f(*args, **kw)
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/web/common.py",
 line 220, in renderHTTP
     return m(ctx)
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/web/filenode.py",
 line 181, in render_GET
     if self.node.is_mutable():
   File
 "/home/zooko/playground/allmydata/tahoe/trunk/optimize_directories/src/allmydata/test/common.py",
 line 183, in is_mutable
     return self.my_uri.is_mutable()
 exceptions.AttributeError: CHKFileVerifierURI instance has no attribute
 'is_mutable'
 -------------------------------------------------------------------------------
 Ran 4 tests in 0.586s

 FAILED (failures=4, errors=2)
 }}}

-- 
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/749>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid


More information about the tahoe-dev mailing list