The py-mysql tox target will sometimes fail after the py27 target is run in the same session

Bug #1438300 reported by Chris Dent
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Chris Dent

Bug Description

This is intermittent and appears to be related to a magic mock not being fully established and then lingering when later debuggin handling tries to use the mocked object. I'm investigating and will provide a fix asap.

(Making the bug simply to have something to hang to changeset on.)

Chris Dent (cdent)
summary: - The py-mysql tox target will sometimes fail after the py27 tareget is
- run in the same session
+ The py-mysql tox target will sometimes fail after the py27 target is run
+ in the same session
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
assignee: nobody → Chris Dent (chdent)
status: New → In Progress
Revision history for this message
gordon chung (chungg) wrote :

cool! you fixed my bug. marking mine as dup

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/169005
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=3405824823161e9ea5ce4474b6e701bda369bdb4
Submitter: Jenkins
Branch: master

commit 3405824823161e9ea5ce4474b6e701bda369bdb4
Author: Chris Dent <email address hidden>
Date: Mon Mar 30 16:58:46 2015 +0000

    Avoid a error when py27 and py-mysql tests run in sequence

    An imcompletely MagicMock can lead to:

      File "ceilometer/network/statistics/opencontrail/client.py", line
      107, in _log_res
          LOG.debug(''.join(dump))
          TypeError: sequence item 3: expected string, MagicMock found

    When the py-mysql tox test target is run after the py27 target.

    This happens because the Mock is not sufficiently formed for the
    places where it gets used. The "dump" above needs to have a value
    for 'reason'.

    Change-Id: I36fd406a06958e795ecf9aa9ff933eddaa979fc8
    Closes-Bug: #1438300

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
Chris Dent (cdent) wrote :

The fix for this was incomplete but because of the vagueries of when it happens, my local testing didn't notice. It turns out that resp.raw_version is wrong. It needs to be response.raw.version. Another patchset forthcoming.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → kilo-rc1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/170092
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=931d7a415e86f795a5e9fca89a511a3be641b8d9
Submitter: Jenkins
Branch: master

commit 931d7a415e86f795a5e9fca89a511a3be641b8d9
Author: Chris Dent <email address hidden>
Date: Thu Apr 2 12:53:34 2015 +0100

    Further mock adjustments to deal with intermittent failure

    When the py-mysql tox target is run after the py27 tox target it can
    sometimes fail because a MagicMock was not properly initialized.
    This change more completely fleshes out the mock so that a TypeError
    does not occur when a debugging log message is caused. The
    specifics of why the logging only happens sometimes are not
    understood.

    Change-Id: I99f80d794b757a0ac05f7a9b53974ba9913e6e68
    Closes-Bug: #1438300

Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: kilo-rc1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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