intermittent v2 unit test failures

Bug #1759951 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Low
Brian Rosmaita
Queens
Fix Released
Low
Cyril Roelandt

Bug Description

I've been seeing these intermittently. They don't seem to happen in a fresh environment, but happen mostly in py27 on test re-runs:

======================================================================
FAIL: glanceclient.tests.unit.v2.test_shell_v2.ShellV2Test.test_do_image_download_with_500
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "glanceclient/tests/unit/v2/test_shell_v2.py", line 791, in test_do_image_download_with_500
    self.assertEqual(1, mocked_data.call_count)
  File "/opt/stack/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/opt/stack/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 1 != 0
======================================================================
FAIL: glanceclient.tests.unit.v2.test_shell_v2.ShellV2Test.test_do_image_download_with_forbidden_id
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "glanceclient/tests/unit/v2/test_shell_v2.py", line 776, in test_do_image_download_with_forbidden_id
    self.assertEqual(1, mocked_data.call_count)
  File "/opt/stack/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/opt/stack/python-glanceclient/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 1 != 0

I think the problem is Change-Id: I841bebeda38814235079429eca0b1e5fd2f04dae , which moved the check to make sure there was someplace specified to put the data to the beginning of the do_image_download function. Fix is to modify the two tests so that they will make it past the data check and then encounter the 500 or 403 and test to make sure the error is handled correctly.

Tags: testing
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

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

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

Reviewed: https://review.openstack.org/557834
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=dc3ee4aedbd9023bba1581a987b517f00b9bfd0e
Submitter: Zuul
Branch: master

commit dc3ee4aedbd9023bba1581a987b517f00b9bfd0e
Author: Brian Rosmaita <email address hidden>
Date: Thu Mar 29 17:21:59 2018 -0400

    Fix intermittent v2 shell unit test failures

    The do_image_download code has a check to make sure that there's
    a place to put the data (either filename or stdout redirect) before
    initiating the download. The location of this check was moved by
    change I841bebeda38814235079429eca0b1e5fd2f04dae to happen at the
    beginning of the function. The two intermittently failing tests
    do not explicitly address the check condition, and as a result the
    tests do exit early, but before they can check what they're supposed
    to be testing.

    Closes-bug: #1759951

    Change-Id: I3c85bb358f669504b364d55618c21382b7a2a66b

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

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/559355

Changed in python-glanceclient:
milestone: none → 2.11.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (stable/queens)

Reviewed: https://review.openstack.org/559355
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=22568b0c131e41d57b9c24631925517c933307bc
Submitter: Zuul
Branch: stable/queens

commit 22568b0c131e41d57b9c24631925517c933307bc
Author: Brian Rosmaita <email address hidden>
Date: Thu Mar 29 17:21:59 2018 -0400

    Fix intermittent v2 shell unit test failures

    The do_image_download code has a check to make sure that there's
    a place to put the data (either filename or stdout redirect) before
    initiating the download. The location of this check was moved by
    change I841bebeda38814235079429eca0b1e5fd2f04dae to happen at the
    beginning of the function. The two intermittently failing tests
    do not explicitly address the check condition, and as a result the
    tests do exit early, but before they can check what they're supposed
    to be testing.

    Closes-bug: #1759951

    Change-Id: I3c85bb358f669504b364d55618c21382b7a2a66b
    (cherry picked from commit dc3ee4aedbd9023bba1581a987b517f00b9bfd0e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-glanceclient 2.10.0

This issue was fixed in the openstack/python-glanceclient 2.10.0 release.

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.