Comment 31 for bug 1482633

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.service (master)

Reviewed: https://review.opendev.org/735882
Committed: https://git.openstack.org/cgit/openstack/oslo.service/commit/?id=ebc2d8a42fd27f9f532dbcf10d73032412bdbb04
Submitter: Zuul
Branch: master

commit ebc2d8a42fd27f9f532dbcf10d73032412bdbb04
Author: Hervé Beraud <email address hidden>
Date: Tue Jun 16 13:34:33 2020 +0200

    Fix wsgi/SSL/ipv6 tests for wsgi module under python 3

    Previously some tests were ignored under python 3 environment, this was
    due to some design changes introduced by python 3.7 [1] in the SSL
    module of the stdlib. These changes reactivate some of them (some other
    are still skipped and needs further works).

    Indeed, when we try to use requests with SSL in a monkey patched
    environment we faced the following issue:

    ```
    TypeError: wrap_socket() got an unexpected keyword argument '_context'
    ```

    This is due to the fact that we are in a monkey patched environment
    where `requests` is monkey patched too.

    We don't need `request` for our needs. Indeed we can easily send
    http requests through low level socket. Our main goal is to test
    our wsgi server and not to test the `requests` library, and `requests`
    was just used to make the code more simpler.

    In our case we can implement a code dedicated to send request to our green
    server, unlock our tests and move away from this bug/side effect.

    These changes move away from `requests` which is badly monkey patched by
    eventlet [1]. Now we use monkey patched socket and ssl to
    request the green server which is executed in background. Low level
    (monkey patched) modules could help us to skirt layers that are possibly
    badly monkey patched on higher level modules (urllib, requests, etc...).

    [1] https://github.com/eventlet/eventlet/issues/526#issuecomment-482694279
    [2] https://github.com/eventlet/eventlet/issues/526

    Change-Id: Iacdde51d2d923bafa3263fa3dc12de8d501d471a
    Partial-Bug: #1482633