Comment 30 for bug 1482633

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

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

commit bfc817294297dddf93fd943264cc01aa6fd03c82
Author: Hervé Beraud <email address hidden>
Date: Tue May 26 18:39:29 2020 +0200

    Fix some SSL 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: Id44ad12a1cf3fd7090a67bb6e8e42bfdc47502cf
    Partial-Bug: #1482633