Functional tests "test_list_shares_by_{filter}" fail sporadically on the gate

Bug #1821945 reported by Goutham Pacha Ravi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-manilaclient
Fix Released
Medium
Goutham Pacha Ravi

Bug Description

Observed on

The test "manilaclient.tests.functional.test_shares_listing.SharesListReadWriteTest.test_list_shares_by_status" fails with the following error:

ft1.16: manilaclient.tests.functional.test_shares_listing.SharesListReadWriteTest.test_list_shares_by_statustesttools.testresult.real._StringException: Traceback (most recent call last):
  File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/test_shares_listing.py", line 229, in test_list_shares_by_status
    self._list_shares({'status': 'available'})
  File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/test_shares_listing.py", line 177, in _list_shares
    self.assertEqual(v, get[k])
  File "/opt/stack/new/python-manilaclient/.tox/functional/lib/python3.6/site-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/opt/stack/new/python-manilaclient/.tox/functional/lib/python3.6/site-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 'available' != 'migrating'

It looks like the test filters the shares by status and then a migration occurs on the share by the time it retrieves the share details.

tags: added: tests
tags: added: low-hanging-fruit
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

This behavior is observed for other tests as well:

test_list_shares_by_share_network
fail
[x]

ft1.19: manilaclient.tests.functional.test_shares_listing.SharesListReadWriteTest.test_list_shares_by_share_networktesttools.testresult.real._StringException: Traceback (most recent call last):
  File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/test_shares_listing.py", line 237, in test_list_shares_by_share_network
    self._list_shares({'share_network': share_network_id})
  File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/test_shares_listing.py", line 173, in _list_shares
    self.assertEqual(v, get[k])
  File "/opt/stack/new/python-manilaclient/.tox/functional/lib/python3.6/site-packages/testtools/testcase.py", line 415, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/opt/stack/new/python-manilaclient/.tox/functional/lib/python3.6/site-packages/testtools/testcase.py", line 502, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = '48fdf8ca-732d-418a-b285-b401d664d300'
actual = 'c5eb386b-d386-4ced-ae74-2540be854fd7'

This failure was also because there was a migration on the concerned share that completed between the "list" and the "get" calls here: https://opendev.org/openstack/python-manilaclient/src/commit/0ca91287acffece4f78451e160fafa040a988f5a/manilaclient/tests/functional/test_shares_listing.py#L154-L173

summary: - Functional test "test_list_shares_by_status" fails sporadically on the
+ Functional tests "test_list_shares_by_{filter}" fail sporadically on the
gate
Changed in python-manilaclient:
importance: Undecided → Medium
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Fix proposed to master:

    Fix test failures for "test_list_shares_by_{filter}"
    https://review.opendev.org/780963

Changed in python-manilaclient:
milestone: none → wallaby-client-release
assignee: nobody → Goutham Pacha Ravi (gouthamr)
status: New → In Progress
tags: removed: low-hanging-fruit
tags: added: wallaby-rc-bugsquash
Changed in python-manilaclient:
status: In Progress → Fix Released
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Partial fix proposed to branch: master
    https://review.opendev.org/783394
    Further fix to "test_list_shares_by_status"

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

This issue was fixed in the openstack/python-manilaclient 2.7.0 release.

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

Reviewed: https://review.opendev.org/c/openstack/python-manilaclient/+/783394
Committed: https://opendev.org/openstack/python-manilaclient/commit/de1902786a71716f6a1ef44cfb7fd1d7b43d2e63
Submitter: "Zuul (22348)"
Branch: master

commit de1902786a71716f6a1ef44cfb7fd1d7b43d2e63
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Mar 26 10:24:52 2021 -0700

    Further fix to "test_list_shares_by_status"

    We addressed some test flakiness issues in
    Ife979fd1c026a4c28caf72c012871761fe039988
    We could improve this a bit more since there
    is more than one "migrating" state a share
    can get into; for example: "server_migrating".

    Change-Id: I2424ddf3e7ff9b9382288c3b73626dda81664eb7
    Partial-Bug: #1821945
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-manilaclient (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/python-manilaclient/+/805779

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-manilaclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-manilaclient/+/805779
Committed: https://opendev.org/openstack/python-manilaclient/commit/2fc21c3e0c751622182c4832f375066640a4cc9a
Submitter: "Zuul (22348)"
Branch: master

commit 2fc21c3e0c751622182c4832f375066640a4cc9a
Author: Goutham Pacha Ravi <email address hidden>
Date: Mon Aug 23 22:32:35 2021 -0700

    Fix incorrect dict member lookup

    Lookup by 'id' was missing quotes
    causing sporadic functional test
    failures - sporadic because the test
    gets into this code section only when
    it runs in parallel to some migration
    tests.

    Change-Id: Iadce9d910370246f83f56f27039d9f5585642fbc
    Related-Bug: #1821945
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

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.