test_remembers_relation_removes fails when run alone

Bug #1046459 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyjuju
Triaged
Low
Unassigned

Bug Description

When run as a single test test_remembers_relation_removes fails:

    $ ./test juju.unit.tests.test_lifecycle.UnitLifecycleTest.test_remembers_relation_removes
    Using system zookeeper classpath from /etc/zookeeper/conf/environment
    juju.unit.tests.test_lifecycle
      UnitLifecycleTest
        test_remembers_relation_removes ... [FAIL]

    ===============================================================================
    [FAIL]
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
        result = result.throwExceptionIntoGenerator(g)
      File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
        return g.throw(self.type, self.value, self.tb)
      File "/home/ubuntu/juju/juju/unit/tests/test_lifecycle.py", line 858, in test_remembers_relation_removes
        UnitRelationStateNotFound)
      File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
        current.result = callback(current.result, *args, **kw)
      File "/usr/lib/python2.7/dist-packages/twisted/trial/unittest.py", line 405, in _cb
        "did not catch an error, instead got %r" % (ignore,))
    twisted.trial.unittest.FailTest: did not catch an error, instead got <juju.state.relation.UnitRelationState object at 0x949d6ec>
    juju.unit.tests.test_lifecycle.UnitLifecycleTest.test_remembers_relation_removes
    -------------------------------------------------------------------------------
    Ran 1 tests in 1.089s

    FAILED (failures=1)

However, running the whole test class passes:

    $ ./test juju.unit.tests.test_lifecycle.UnitLifecycleTest
    ...
    Ran 18 tests in 10.483s

    PASSED (successes=18)

This suggests the test is not well isolated, or otherwise depends on specific reactor behaviour quirks.

The test also fails sometimes on older ubuntu versions on the buildbots, which may or may not be related:

    ===============================================================================
    [ERROR]
    Traceback (most recent call last):
    Failure: zookeeper.ConnectionLossException: Retry

    juju.unit.tests.test_lifecycle.UnitLifecycleTest.test_remembers_relation_removes
    -------------------------------------------------------------------------------

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.