test_wsgi.py fails with AttributeError with eventlet 0.17.4

Bug #1777836 reported by Alistair Coles
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Alistair Coles

Bug Description

This bug is masked by https://bugs.launchpad.net/swift/+bug/1777701 so will only manifest *in unit tests* when that bug is fixed.

eventler <=0.17.4 LogFileWrapper doesn't have an error() method but swift common/wsgi.py may try to call that method, and unit tests provoke that code path.

Error
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "/Users/anc/0dev/swift/test/unit/common/test_wsgi.py", line 1208, in test_malformed_proxy_lines
    bad_line, wsgi.SwiftHttpProxiedProtocol)
  File "/Users/anc/0dev/swift/test/unit/common/test_wsgi.py", line 1132, in _run_bytes_through_protocol
    log_output=False, # quiet the test run
  File "/Users/anc/VirtualEnvs/swift/lib/python2.7/site-packages/eventlet/wsgi.py", line 834, in server
    pool.execute_async(serv.process_request, client_socket)
AttributeError: 'FakePool' object has no attribute 'execute_async'

(22551) wsgi starting up on http://127.0.0.1:8359/
(22551) accepted ('127.0.0.1', 8359)
(22551) wsgi exited, is_accepting=True

Error
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "/Users/anc/0dev/swift/test/unit/common/test_wsgi.py", line 1197, in test_missing_proxy_line
    ), wsgi.SwiftHttpProxiedProtocol)
  File "/Users/anc/0dev/swift/test/unit/common/test_wsgi.py", line 1132, in _run_bytes_through_protocol
    log_output=False, # quiet the test run
  File "/Users/anc/VirtualEnvs/swift/lib/python2.7/site-packages/eventlet/wsgi.py", line 834, in server
    pool.execute_async(serv.process_request, client_socket)
AttributeError: 'FakePool' object has no attribute 'execute_async'

Changed in swift:
assignee: nobody → Alistair Coles (alistair-coles)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

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

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

Reviewed: https://review.openstack.org/576801
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=a1cb91993096971934755cae08aa8013c10fc8f9
Submitter: Zuul
Branch: master

commit a1cb91993096971934755cae08aa8013c10fc8f9
Author: Alistair Coles <email address hidden>
Date: Wed Jun 20 10:09:38 2018 +0100

    Use valid eventlet logger method

    eventlet<=0.17.4 LoggerFileWrapper does not have an error() method
    so don't try to call it. Instead, use info() which even in newer
    eventlet versions does exactly the same as error().

    This bug only manifests in unit tests once the Related-Bug has been fixed
    (see Related-Change).

    Closes-Bug: #1777836
    Related-Bug: #1777701
    Related-Change: I68fd9d0263a6720aaf0d90b8ea6da1158105ac01

    Change-Id: I46190567549826c811ffa51e9a71a38a20d9ce97

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

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