functional tests fail when run under python3

Bug #1811516 reported by Tom Barron
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-manilaclient
Fix Released
Medium
Tom Barron

Bug Description

When run with python 3, functional tests fail with tracebacks like the following from the test client:

2019-01-09 15:38:18.718357 | primary | 2019-01-09 15:38:18.717 | b'Traceback (most recent call last):'
2019-01-09 15:38:18.720127 | primary | 2019-01-09 15:38:18.719 | b' File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/base.py", line 69, in tearDownClass'
2019-01-09 15:38:18.722347 | primary | 2019-01-09 15:38:18.721 | b' cls.clear_resources(cls.class_resources)'
2019-01-09 15:38:18.724053 | primary | 2019-01-09 15:38:18.723 | b' File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/base.py", line 108, in clear_resources'
2019-01-09 15:38:18.725624 | primary | 2019-01-09 15:38:18.724 | b' res_id, microversion=res["microversion"])'
2019-01-09 15:38:18.727303 | primary | 2019-01-09 15:38:18.726 | b' File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/client.py", line 725, in wait_for_share_deletion'
2019-01-09 15:38:18.728826 | primary | 2019-01-09 15:38:18.728 | b' microversion=microversion)'
2019-01-09 15:38:18.731479 | primary | 2019-01-09 15:38:18.730 | b' File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/client.py", line 143, in wait_for_resource_deletion'
2019-01-09 15:38:18.733353 | primary | 2019-01-09 15:38:18.732 | b' deleted = func(res_id, microversion=microversion)'
2019-01-09 15:38:18.734818 | primary | 2019-01-09 15:38:18.734 | b' File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/client.py", line 713, in is_share_deleted'
2019-01-09 15:38:18.736633 | primary | 2019-01-09 15:38:18.736 | b' self.get_share(share, microversion=microversion)'
2019-01-09 15:38:18.738258 | primary | 2019-01-09 15:38:18.737 | b' File "/opt/stack/new/python-manilaclient/manilaclient/tests/functional/client.py", line 47, in wrapped_func'
2019-01-09 15:38:18.739739 | primary | 2019-01-09 15:38:18.739 | b' if re.search(regexp, e.stderr):'
2019-01-09 15:38:18.741498 | primary | 2019-01-09 15:38:18.740 | b' File "/opt/stack/new/python-manilaclient/.tox/functional/lib/python3.5/re.py", line 173, in search'
2019-01-09 15:38:18.743474 | primary | 2019-01-09 15:38:18.742 | b' return _compile(pattern, flags).search(string)'
2019-01-09 15:38:18.745238 | primary | 2019-01-09 15:38:18.744 | b'TypeError: cannot use a string pattern on a bytes-like object'
2019-01-09 15:38:18.753589 | primary | 2019-01-09 15:38:18.751 | b'

Tom Barron (tpb)
Changed in python-manilaclient:
importance: Undecided → Medium
milestone: none → stein-2
assignee: nobody → Tom Barron (tpb)
tags: added: python3 tests
Changed in python-manilaclient:
status: New → In Progress
Changed in python-manilaclient:
assignee: Tom Barron (tpb) → Goutham Pacha Ravi (gouthamr)
Changed in python-manilaclient:
assignee: Goutham Pacha Ravi (gouthamr) → Tom Barron (tpb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-manilaclient (master)

Reviewed: https://review.openstack.org/630462
Committed: https://git.openstack.org/cgit/openstack/python-manilaclient/commit/?id=b955ac9064b15d00e8966dda745814c146c8af01
Submitter: Zuul
Branch: master

commit b955ac9064b15d00e8966dda745814c146c8af01
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Jan 16 16:31:21 2019 -0800

    [Python3] Fix python3 bugs in code

    - The BaseException class no longer has a "message"
      attribute in python 3 [1]. On the contrary, the
      string representation of an Exception object will
      print all the exception args in all supported
      python versions, so use that instead.
    - Functional tests were run with a specific locale,
      remove those annotations so we can handle unicode
      encoding and decoding in python3 envs.
    - Cleanup errors were not being handled correctly,
      cleanup the code so we don't have spurious failures.
    - In python3, dict.keys() gives you a view for lazy
      loading, so convert occurrences to lists as expected
      in our functional tests.
    - Start capturing STDOUT and STDERR in tox envs to
      enable troubleshooting.

    Co-Authored-By: Goutham Pacha Ravi <email address hidden>
    Closes-Bug: #1811627
    Closes-Bug: #1811516
    Change-Id: Idaa2fb9b60451b3fbd298e19574195f2d663c6f4
    [1] https://www.python.org/dev/peps/pep-0352/#transition-plan

Changed in python-manilaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-manilaclient 1.26.0

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-manilaclient (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/757651

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

Reviewed: https://review.opendev.org/757651
Committed: https://git.openstack.org/cgit/openstack/python-manilaclient/commit/?id=c0ce858da632355404906b6b05ee8de232a1b6fa
Submitter: Zuul
Branch: stable/rocky

commit c0ce858da632355404906b6b05ee8de232a1b6fa
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Jan 16 16:31:21 2019 -0800

    [Python3] Fix python3 bugs in code

    - The BaseException class no longer has a "message"
      attribute in python 3 [1]. On the contrary, the
      string representation of an Exception object will
      print all the exception args in all supported
      python versions, so use that instead.
    - Functional tests were run with a specific locale,
      remove those annotations so we can handle unicode
      encoding and decoding in python3 envs.
    - Cleanup errors were not being handled correctly,
      cleanup the code so we don't have spurious failures.
    - In python3, dict.keys() gives you a view for lazy
      loading, so convert occurrences to lists as expected
      in our functional tests.
    - Start capturing STDOUT and STDERR in tox envs to
      enable troubleshooting.

    Co-Authored-By: Goutham Pacha Ravi <email address hidden>
    Closes-Bug: #1811627
    Closes-Bug: #1811516
    Change-Id: Idaa2fb9b60451b3fbd298e19574195f2d663c6f4
    [1] https://www.python.org/dev/peps/pep-0352/#transition-plan
    (cherry picked from commit b955ac9064b15d00e8966dda745814c146c8af01)
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-manilaclient (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/757957

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

Reviewed: https://review.opendev.org/757957
Committed: https://git.openstack.org/cgit/openstack/python-manilaclient/commit/?id=454eee65ef827cd3305a37b7bb3674d8408d0879
Submitter: Zuul
Branch: stable/queens

commit 454eee65ef827cd3305a37b7bb3674d8408d0879
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Jan 16 16:31:21 2019 -0800

    [Python3] Fix python3 bugs in code

    - The BaseException class no longer has a "message"
      attribute in python 3 [1]. On the contrary, the
      string representation of an Exception object will
      print all the exception args in all supported
      python versions, so use that instead.
    - Functional tests were run with a specific locale,
      remove those annotations so we can handle unicode
      encoding and decoding in python3 envs.
    - Cleanup errors were not being handled correctly,
      cleanup the code so we don't have spurious failures.
    - In python3, dict.keys() gives you a view for lazy
      loading, so convert occurrences to lists as expected
      in our functional tests.
    - Start capturing STDOUT and STDERR in tox envs to
      enable troubleshooting.

    Co-Authored-By: Goutham Pacha Ravi <email address hidden>
    Closes-Bug: #1811627
    Closes-Bug: #1811516
    Change-Id: Idaa2fb9b60451b3fbd298e19574195f2d663c6f4
    [1] https://www.python.org/dev/peps/pep-0352/#transition-plan
    (cherry picked from commit b955ac9064b15d00e8966dda745814c146c8af01)
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit c0ce858da632355404906b6b05ee8de232a1b6fa)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-manilaclient queens-eol

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

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

This issue was fixed in the openstack/python-manilaclient rocky-eol 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.