test failures due to new mock 2.0.0 release

Bug #1567079 reported by Eric Harney
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Eric Harney
Liberty
Fix Released
High
Unassigned
Mitaka
Fix Released
High
Unassigned

Bug Description

Seeing lots of test failures in the gate similar to:

http://logs.openstack.org/44/301444/6/check/gate-cinder-python27-db/d2a40b8/console.html

2016-04-06 17:55:37.231 |
2016-04-06 17:55:37.232 | cinder.tests.unit.test_test.MockAssertTestCase.test_invalid_assert_calls
2016-04-06 17:55:37.232 | ------------------------------------------------------------------------
2016-04-06 17:55:37.232 |
2016-04-06 17:55:37.232 | Captured traceback:
2016-04-06 17:55:37.232 | ~~~~~~~~~~~~~~~~~~~
2016-04-06 17:55:37.232 | Traceback (most recent call last):
2016-04-06 17:55:37.233 | File "cinder/tests/unit/test_test.py", line 77, in test_invalid_assert_calls
2016-04-06 17:55:37.233 | self.assertRaises(AttributeError, lambda: mock_call.assert_called)
2016-04-06 17:55:37.233 | File "/home/jenkins/workspace/gate-cinder-python27-db/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 434, in assertRaises
2016-04-06 17:55:37.233 | self.assertThat(our_callable, matcher)
2016-04-06 17:55:37.233 | File "/home/jenkins/workspace/gate-cinder-python27-db/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 447, in assertThat
2016-04-06 17:55:37.233 | raise mismatch_error
2016-04-06 17:55:37.233 | testtools.matchers._impl.MismatchError: <function <lambda> at 0x7f435aaf6e60> returned <bound method MagicMock.assert_called of <MagicMock id='139927202691600'>>
2016-04-06 17:55:37.234 |

This is due to a new mock release 2.0.0 today.

https://github.com/openstack/cinder/blob/master/cinder/test.py#L104

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

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

Changed in cinder:
assignee: nobody → Eric Harney (eharney)
status: New → In Progress
Eric Harney (eharney)
tags: added: tests
tags: added: gate-failure
Revision history for this message
Eric Harney (eharney) wrote : Re: test failures due to new mock release

This failed because mock 2.0.0 includes new assert_called and assert_called_once methods:
https://github.com/testing-cabal/mock/commit/7ca5d3afe

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

Reviewed: https://review.openstack.org/302439
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=d21b9347183b66b8bb566414b008cc277b9e2029
Submitter: Jenkins
Branch: master

commit d21b9347183b66b8bb566414b008cc277b9e2029
Author: Eric Harney <email address hidden>
Date: Wed Apr 6 17:02:08 2016 -0400

    Remove "patch mock to raise for invalid assert calls"

    This looks like it's causing problems with a new
    mock 2.0.0 release, proposing to just remove it to
    keep things working.

    Closes-Bug: #1567079
    Change-Id: I2a82eec20f8099c0651a21ac7aed1a0771ef5297

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/304114

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/304115

Eric Harney (eharney)
Changed in cinder:
importance: Undecided → High
summary: - test failures due to new mock release
+ test failures due to new mock 2.0.0 release
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/mitaka)

Reviewed: https://review.openstack.org/304114
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=f3a06168b91c4c979e7d65412a685d258bd4f648
Submitter: Jenkins
Branch: stable/mitaka

commit f3a06168b91c4c979e7d65412a685d258bd4f648
Author: Eric Harney <email address hidden>
Date: Wed Apr 6 17:02:08 2016 -0400

    Remove "patch mock to raise for invalid assert calls"

    This looks like it's causing problems with a new
    mock 2.0.0 release, proposing to just remove it to
    keep things working.

    Closes-Bug: #1567079
    Change-Id: I2a82eec20f8099c0651a21ac7aed1a0771ef5297
    (cherry picked from commit d21b9347183b66b8bb566414b008cc277b9e2029)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/liberty)

Reviewed: https://review.openstack.org/304115
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=e285bc276a42c7ce62a994525c8fc144d567b692
Submitter: Jenkins
Branch: stable/liberty

commit e285bc276a42c7ce62a994525c8fc144d567b692
Author: Eric Harney <email address hidden>
Date: Wed Apr 6 17:02:08 2016 -0400

    Remove "patch mock to raise for invalid assert calls"

    This looks like it's causing problems with a new
    mock 2.0.0 release, proposing to just remove it to
    keep things working.

    Closes-Bug: #1567079
    Change-Id: I2a82eec20f8099c0651a21ac7aed1a0771ef5297
    (cherry picked from commit d21b9347183b66b8bb566414b008cc277b9e2029)

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 7.0.2

This issue was fixed in the openstack/cinder 7.0.2 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 9.0.0.0b1

This issue was fixed in the openstack/cinder 9.0.0.0b1 development milestone.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 8.1.0

This issue was fixed in the openstack/cinder 8.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 7.0.2

This issue was fixed in the openstack/cinder 7.0.2 release.

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.