Tests fail on xenial

Bug #1550002 reported by Andreas Hasenack on 2016-02-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
txAWS
Undecided
Unassigned

Bug Description

There are at least 9 test failures on xenial, possibly due to twisted 16. They all point at a string vs integer mismatch:
txaws.tests.test_wsdl.WDSLParserTestCase.test_parse_describe_security_groups_response
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1656, in test_400_error
    error = self.assertRaises(EC2Error, client.ec2_error_wrapper, failure)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in assertRaises
    return context._handle(lambda: f(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 358, in __exit__
    self._expectedName, reason.getTraceback()),
twisted.trial.unittest.FailTest: exceptions.TypeError raised instead of EC2Error:
 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/utils.py", line 197, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1656, in test_400_error
    error = self.assertRaises(EC2Error, client.ec2_error_wrapper, failure)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in assertRaises
    return context._handle(lambda: f(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in <lambda>
    return context._handle(lambda: f(*args, **kwargs))
  File "/home/ubuntu/src/txaws/txaws/ec2/client.py", line 23, in ec2_error_wrapper
    error_wrapper(error, EC2Error)
  File "/home/ubuntu/src/txaws/txaws/client/base.py", line 59, in error_wrapper
    xml_payload, error.value.status, str(error.value),
  File "/usr/lib/python2.7/dist-packages/twisted/web/error.py", line 90, in __str__
    return nativeString(self.status + b" " + self.message)
exceptions.TypeError: unsupported operand type(s) for +: 'int' and 'str'

txaws.ec2.tests.test_client.EC2ErrorWrapperTestCase.test_400_error
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1664, in test_404_error
    error = self.assertRaises(EC2Error, client.ec2_error_wrapper, failure)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in assertRaises
    return context._handle(lambda: f(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 358, in __exit__
    self._expectedName, reason.getTraceback()),
twisted.trial.unittest.FailTest: exceptions.TypeError raised instead of EC2Error:
 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/utils.py", line 197, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1664, in test_404_error
    error = self.assertRaises(EC2Error, client.ec2_error_wrapper, failure)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in assertRaises
    return context._handle(lambda: f(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in <lambda>
    return context._handle(lambda: f(*args, **kwargs))
  File "/home/ubuntu/src/txaws/txaws/ec2/client.py", line 23, in ec2_error_wrapper
    error_wrapper(error, EC2Error)
  File "/home/ubuntu/src/txaws/txaws/client/base.py", line 59, in error_wrapper
    xml_payload, error.value.status, str(error.value),
  File "/usr/lib/python2.7/dist-packages/twisted/web/error.py", line 90, in __str__
    return nativeString(self.status + b" " + self.message)
exceptions.TypeError: unsupported operand type(s) for +: 'int' and 'str'

txaws.ec2.tests.test_client.EC2ErrorWrapperTestCase.test_404_error
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1688, in test_500_error
    error = self.assertRaises(EC2Error, client.ec2_error_wrapper, failure)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in assertRaises
    return context._handle(lambda: f(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 358, in __exit__
    self._expectedName, reason.getTraceback()),
twisted.trial.unittest.FailTest: exceptions.TypeError raised instead of EC2Error:
 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/utils.py", line 197, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1688, in test_500_error
    error = self.assertRaises(EC2Error, client.ec2_error_wrapper, failure)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in assertRaises
    return context._handle(lambda: f(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in <lambda>
    return context._handle(lambda: f(*args, **kwargs))
  File "/home/ubuntu/src/txaws/txaws/ec2/client.py", line 23, in ec2_error_wrapper
    error_wrapper(error, EC2Error)
  File "/home/ubuntu/src/txaws/txaws/client/base.py", line 59, in error_wrapper
    xml_payload, error.value.status, str(error.value),
  File "/usr/lib/python2.7/dist-packages/twisted/web/error.py", line 90, in __str__
    return nativeString(self.status + b" " + self.message)
exceptions.TypeError: unsupported operand type(s) for +: 'int' and 'str'

txaws.ec2.tests.test_client.EC2ErrorWrapperTestCase.test_500_error
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1679, in test_non_EC2_404_error
    TwistedWebError, client.ec2_error_wrapper, failure)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in assertRaises
    return context._handle(lambda: f(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 358, in __exit__
    self._expectedName, reason.getTraceback()),
twisted.trial.unittest.FailTest: exceptions.TypeError raised instead of Error:
 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/utils.py", line 197, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1679, in test_non_EC2_404_error
    TwistedWebError, client.ec2_error_wrapper, failure)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in assertRaises
    return context._handle(lambda: f(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 320, in _handle
    self._returnValue = obj()
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 426, in <lambda>
    return context._handle(lambda: f(*args, **kwargs))
  File "/home/ubuntu/src/txaws/txaws/ec2/client.py", line 23, in ec2_error_wrapper
    error_wrapper(error, EC2Error)
  File "/home/ubuntu/src/txaws/txaws/client/base.py", line 59, in error_wrapper
    xml_payload, error.value.status, str(error.value),
  File "/usr/lib/python2.7/dist-packages/twisted/web/error.py", line 90, in __str__
    return nativeString(self.status + b" " + self.message)
exceptions.TypeError: unsupported operand type(s) for +: 'int' and 'str'

txaws.ec2.tests.test_client.EC2ErrorWrapperTestCase.test_non_EC2_404_error
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1725, in test_response_parse_error
    self.assertEquals(str(error), "400 Bad Request")
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 437, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/lib/python2.7/unittest/case.py", line 513, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 506, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: "unsupported operand type(s) for +: 'int' and 'str'" != '400 Bad Request'

txaws.ec2.tests.test_client.EC2ErrorWrapperTestCase.test_response_parse_error
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1842, in check_error
    self.assertEquals(error.status, status)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 437, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/lib/python2.7/unittest/case.py", line 513, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 506, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: '400' != 400

txaws.ec2.tests.test_client.QueryTestCase.test_submit_400
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1893, in check_error
    self.assertEquals(error.status, status)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 437, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/lib/python2.7/unittest/case.py", line 513, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 506, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: '500' != 500

txaws.ec2.tests.test_client.QueryTestCase.test_submit_500
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/ec2/tests/test_client.py", line 1868, in check_error
    self.assertEquals(error.status, status)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 437, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/lib/python2.7/unittest/case.py", line 513, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 506, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: '400' != 400

txaws.ec2.tests.test_client.QueryTestCase.test_submit_non_EC2_400
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/ubuntu/src/txaws/txaws/tests/test_exception.py", line 18, in test_creation
    self.assertEquals(error.status, 500)
  File "/usr/lib/python2.7/dist-packages/twisted/trial/_synctest.py", line 437, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/lib/python2.7/unittest/case.py", line 513, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 506, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: '500' != 500

txaws.tests.test_exception.AWSErrorTestCase.test_creation
-------------------------------------------------------------------------------
Ran 499 tests in 0.749s

FAILED (skips=56, failures=9, successes=434)

Andreas Hasenack (ahasenack) wrote :

This makes the test pass on both xenial and wily, but I'm not sure about the others with older versions of twisted, nor if this is a valid fix. I just gave it a shot.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers