Problem running tests

Asked by Anthony Lenton

I've not been able to run the tests that come with txamqp so far, I'm wondering what I'm doing wrong.

I have python 2.6.2, twisted 8.2.0, txamqp head (rev. 15 atm), and an out-of-the-box rabbitmq-server installed.

At first I used "trial txamqp/test" while standing in src/, and the tests would just hang during the call to client.authenticate in TestBase.connect(). They'd timeout after two minutes with not much of a traceback.

Changing TestBase's vhost from 'localhost' to '/' (line 41 of testlib.py), or configuring a 'localhost' vhost and assigning user 'guest' to it, makes the hangs go away. It now instead gives many errors, similar to the following one:

(This is what it outputs when running "trial txamqp/text/test_example.py" from within src/)

anthony@agave:~/bzr/txamqp/src$ trial txamqp/test/test_example.py
txamqp.test.test_example
  ExampleTest
    test_example ... [ERROR]
                                                   [ERROR]
                                                   [ERROR]

===============================================================================
[ERROR]: txamqp.test.test_example.ExampleTest.test_example

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 749, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.6/dist-packages/twisted/python/failure.py", line 338, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/home/anthony/bzr/txamqp/src/txamqp/test/test_example.py", line 75, in test_example
    reply = yield channel.basic_consume(queue="test-queue")
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 749, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.6/dist-packages/twisted/python/failure.py", line 338, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/home/anthony/bzr/txamqp/src/txamqp/protocol.py", line 85, in invoke
    raise Closed(self.reason)
txamqp.client.Closed: Method(name=close, id=60) (501, 'FRAME_ERROR - cannot decode <<0,0,10,116,101,115,116,45,113,117,101,117,101,0,0,0,0,0,0>>', 60, 20) content = None
===============================================================================
[ERROR]: txamqp.test.test_example.ExampleTest.test_example

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 751, in _inlineCallbacks
    result = g.send(result)
  File "/home/anthony/bzr/txamqp/src/txamqp/protocol.py", line 55, in invoke
    raise Closed(self.reason)
txamqp.client.Closed: Method(name=close, id=60) (501, 'FRAME_ERROR - cannot decode <<0,0,10,116,101,115,116,45,113,117,101,117,101,0,0,0,0,0,0>>', 60, 20) content = None
===============================================================================
[ERROR]: txamqp.test.test_example.ExampleTest.test_example

Traceback (most recent call last):
Failure: twisted.trial.util.DirtyReactorAggregateError: Reactor was unclean.
Selectables:
<<class 'twisted.internet.tcp.Client'> to ('localhost', 5672) at a5fe6ec>
-------------------------------------------------------------------------------
Ran 1 tests in 0.403s

FAILED (errors=3)
anthony@agave:~/bzr/txamqp/src$

--------------------------------------------------------------------------------
Most tests fail with this error (501, 'FRAME_ERROR - cannot decode <<0,0,10,116,..... followed by an unclean reactor), though a couple don't fail, and BasicTests.test_get still hangs like before.

Any ideas about what could be causing this, and how to fix it?

Question information

Language:
English Edit question
Status:
Solved
For:
txAMQP Edit question
Assignee:
No assignee Edit question
Solved by:
Anthony Lenton
Solved:
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Esteve Fernandez (esteve) said :
#2

Hi Anthony, sorry for the delay. We just added support for running the test suite against RabbitMQ in trunk. Could you test it?

Thanks!

Revision history for this message
Anthony Lenton (elachuni) said :
#3

Hi Esteve,

I still have to change TestBase's vhost from 'localhost' to '/' or configure a 'localhost' vhost and assign user 'guest' to it, but after that the tests run super smooth. Maybe we could also read the vhost from an environment variable?

Excellent work!

Revision history for this message
Esteve Fernandez (esteve) said :
#4

Hi Anthony,

do you think it makes sense to change vhost depending on the TXAMQP_BROKER environment variable? I mean, we could have several "profiles", one per broker, so that trial works out of the box without having to tinker with TestBase's source code.

Cheers.

Revision history for this message
Anthony Lenton (elachuni) said :
#5

It makes perfect sense for me; not having to modify TestBase to run the test is a large bonus to get people running the tests. I'm not sure that *every* other RabbitMQ ships with a '/' vhost configured by default, but I'd be happy if we change the vhost depending on the TXAMQP_BROKER environment variable for now and see if somebody else complains. :)