Comment 11 for bug 1418541

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

Reviewed: https://review.openstack.org/153225
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ea76d10e7492eb90f6777940304c67691caa366b
Submitter: Jenkins
Branch: master

commit ea76d10e7492eb90f6777940304c67691caa366b
Author: Ihar Hrachyshka <email address hidden>
Date: Thu Feb 5 14:21:38 2015 +0100

    tests: monkey patch stdlib before importing other modules

    Some oslo libraries assume that stdlib is already patched when they are
    imported (f.e. oslo.concurrency.processutils currently checks whether
    time module is monkey patched on import to detect which subprocess
    module should be used).

    For services, we achieve this by moving monkey_patch() calls as high in
    import list as possible. But for tests, we don't control the order in
    which testr loads test cases. So to be on safe side, we should make sure
    any attempt to load a test case from the tree results in eventlet patch.

    We can't put the monkey_patch() call into e.g. neutron/__init__.py to
    reuse it both for tests and for services, because in that case we may
    break flake8 that loads hacking checks from neutron.* namespace and
    relies on proper (unpatched) subprocess module.

    Closes-Bug: #1418541
    Change-Id: Id58409000d0e086f3fb664a15935af4f1708c396