CouchDBAppTest.test_restart failure on stop_db

Bug #1436009 reported by Doug Shelley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
In Progress
High
Doug Shelley

Bug Description

Was running tox -epy27 on local Ubuntu 14.04 VM. Got this failure:
======================================================================
FAIL: guestagent.test_dbaas.CouchDBAppTest.test_restart
tags: worker-1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/doug/temp/trove/trove/tests/unittests/guestagent/test_dbaas.py", line 1842, in test_restart
    self.assertTrue(self.couchdbApp.stop_db.called)
  File "/home/doug/temp/trove/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 678, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

Upon further research, determined that this code is causing the issue:
tests/unittests/guestagent/test_couchdb_manager.py
     def test_restart(self):
         mock_status = MagicMock()
         self.manager.appStatus = mock_status
         couchdb_service.CouchDBApp.restart = MagicMock(return_value=None)
         #invocation
         self.manager.restart(self.context)
         #verification/assertion
         couchdb_service.CouchDBApp.restart.assert_any_call()

Note that CouchDBApp.restart is being Mocked out but never restored...

If this test runs before the above test, the failure will occur. Note: running test_dbaas.py in isolation the test is successful.

Doug Shelley (0-doug)
Changed in trove:
assignee: nobody → Doug Shelley (0-doug)
milestone: none → kilo-rc1
Amrith Kumar (amrith)
Changed in trove:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/167368

Changed in trove:
status: Confirmed → In Progress
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.