Investigate use of save_logging, reset_logging and remove them from tests

Bug #795233 reported by Jim Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyjuju
Fix Released
Medium
Jim Baker

Bug Description

A number of tests (mostly in ensemble.hook, but also in ensemble.control) use the pattern of save_logging/reset_logging, however, this is not used in other tests.

At least one test is currently unreliable in trunk, due to a logging related issue, when looped repeatedly:

./test -u ensemble.hooks.tests.test_invoker
...
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1020, in _inlineCallbacks
    result = g.send(result)
  File "/home/jbaker/canonical/ensemble/mine/expose-hook-commands/ensemble/hooks/tests/test_invoker.py", line 399, in test_spawn_fail
    self.assertInDefaultLog("ERROR")
  File "/home/jbaker/canonical/ensemble/mine/expose-hook-commands/ensemble/lib/testing.py", line 136, in assertInDefaultLog
    return self.assertIn(expected_value, content)
twisted.trial.unittest.FailTest: 'ERROR' not in "hook:DEBUG:: hook fail-hook ended, exit code Traceback (most recent call last):\nFailure: ensemble.errors.FormulaInvocationError: Error processing '/home/jbaker/canonical/ensemble/mine/expose-hook-commands/ensemble/hooks/tests/hooks/fail-hook': exit code 1.\n.\n"

ensemble.hooks.tests.test_invoker.InvokerTest.test_spawn_fail
-------------------------------------------------------------------------------
Ran 23 tests in 11.353s

FAILED (failures=1, successes=22)

At standup, it was determined that this usage should be investigated, conclusions reported to the mailing list, and removed from code so as to be more consistent with other tests.

Tags: expose

Related branches

Jim Baker (jimbaker)
Changed in ensemble:
importance: Undecided → Medium
assignee: nobody → Jim Baker (jimbaker)
milestone: none → dublin
Jim Baker (jimbaker)
Changed in ensemble:
status: New → In Progress
Jim Baker (jimbaker)
Changed in ensemble:
status: In Progress → Fix Released
tags: added: expose
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.