zmq tests should reset config between tests

Bug #1034416 reported by Mark McLoughlin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
Fix Released
Medium
Erica Windisch
Grizzly
Fix Released
Medium
Erica Windisch

Bug Description

In test_zmq.py setUp() we do FLAGS.set_override(), but we don't have a corresponding FLAGS.reset() in tearDown()

This means that that running a test alters the state of FLAGS for all other tests. We should ensure a clean slate after each test.

You can see the subtleties this introduces here:

        ipc_dir = FLAGS.rpc_zmq_ipc_dir

        internal_ipc_dir = '/tmp/openstack-zmq.ipc.test'

        if not os.path.exists(os.path.join(ipc_dir, "zmq_topic_zmq_replies")):
            FLAGS.set_default('rpc_zmq_ipc_dir', internal_ipc_dir)
            ....
        elif ipc_dir != internal_ipc_dir:
            ....

The elif is specifically for the case where FLAGS.rpc_zmq_dir was not overwritten by a previous test.

Mark McLoughlin (markmc)
Changed in openstack-common:
assignee: nobody → Eric Windisch (ewindisch)
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-common (master)

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

Changed in openstack-common:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-common (master)

Reviewed: https://review.openstack.org/14345
Committed: http://github.com/openstack/openstack-common/commit/4d458c0397cf9edd44ac6ce8d94a002a8a8e5286
Submitter: Jenkins
Branch: master

commit 4d458c0397cf9edd44ac6ce8d94a002a8a8e5286
Author: Eric Windisch <email address hidden>
Date: Thu Oct 11 13:50:05 2012 -0400

    Use self.config in test_zmq

    Fixes bug 1034416

    Change-Id: I06f9fb5fa9d86eefeebc82c0e31196b8d542c9e0

Changed in openstack-common:
status: In Progress → Fix Committed
Mark McLoughlin (markmc)
affects: openstack-common → oslo
Mark McLoughlin (markmc)
Changed in oslo:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
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.