TestDesignateClient.test_secure_client fails with AssertionError: Expected call: mock(verify='...')

Bug #1593647 reported by Ihar Hrachyshka
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Ihar Hrachyshka

Bug Description

The test sometimes fails in gate:

http://logs.openstack.org/30/271830/8/check/gate-neutron-python27/4b77bb6/testr_results.html.gz

ft507.2: neutron.tests.unit.plugins.ml2.extensions.test_dns_integration.TestDesignateClient.test_secure_client_StringException: Traceback (most recent call last):
  File "neutron/tests/unit/plugins/ml2/extensions/test_dns_integration.py", line 558, in test_secure_client
    driver.session.Session.assert_called_with(verify=self.TEST_CA_CERT)
  File "/home/jenkins/workspace/gate-neutron-python27/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 925, in assert_called_with
    raise AssertionError('Expected call: %s\nNot called' % (expected,))
AssertionError: Expected call: mock(verify='d7302899d10b4e8381f2345b966fd299')
Not called

Logstash: http://logstash.openstack.org/#dashboard/file/logstash.json?query=message%3A%5C%22in%20test_secure_client%5C%22

tags: added: gate-failure unittest
Changed in neutron:
importance: Undecided → High
description: updated
Revision history for this message
Dariusz Smigiel (smigiel-dariusz) wrote :

It seems to happening just for py27

Changed in neutron:
status: New → Confirmed
Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

Sigh, seems no one actually cared since I reported it. I guess I will need to fix it myself.

Changed in neutron:
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

Reproduction is as simple as: python -m testtools.run neutron.tests.unit.plugins.ml2.extensions.test_dns_integration.TestDesignateClient

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

Reviewed: https://review.openstack.org/331541
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3703b31eea06d5055a7fc63cec7a24b2aaa1c563
Submitter: Jenkins
Branch: master

commit 3703b31eea06d5055a7fc63cec7a24b2aaa1c563
Author: Ihar Hrachyshka <email address hidden>
Date: Mon Jun 20 09:38:13 2016 +0200

    tests: clean up designate client session mock on test exit

    This test was modifying the driver session method without making an
    effort to restore the original value after the test case completion.
    This resulted in two consequent tests that relied on the method that
    were triggered in the same test thread, to trigger a failure for one of
    them.

    Changed the setup logic for the test class to use mock.patch(..).start()
    instead.

    Closes-Bug: #1593647
    Change-Id: I08be90691b5417025c40c5a18308d820dc7a43d2

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

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

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

Reviewed: https://review.openstack.org/331662
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=97088cf1a63d5d1a28ffaf7fa338ad1fb1b84342
Submitter: Jenkins
Branch: stable/mitaka

commit 97088cf1a63d5d1a28ffaf7fa338ad1fb1b84342
Author: Ihar Hrachyshka <email address hidden>
Date: Mon Jun 20 09:38:13 2016 +0200

    tests: clean up designate client session mock on test exit

    This test was modifying the driver session method without making an
    effort to restore the original value after the test case completion.
    This resulted in two consequent tests that relied on the method that
    were triggered in the same test thread, to trigger a failure for one of
    them.

    Changed the setup logic for the test class to use mock.patch(..).start()
    instead.

    Closes-Bug: #1593647
    Change-Id: I08be90691b5417025c40c5a18308d820dc7a43d2
    (cherry picked from commit 3703b31eea06d5055a7fc63cec7a24b2aaa1c563)

tags: added: in-stable-mitaka
Changed in neutron:
status: Fix Released → Confirmed
status: Confirmed → Fix Released
tags: added: neutron-proactive-backport-potential
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 9.0.0.0b2

This issue was fixed in the openstack/neutron 9.0.0.0b2 development milestone.

tags: removed: neutron-proactive-backport-potential
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 8.2.0

This issue was fixed in the openstack/neutron 8.2.0 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.