diff options
author | Victor Stinner <vstinner@redhat.com> | 2015-04-09 12:47:36 +0200 |
---|---|---|
committer | Sergey Shepelev <temotor@gmail.com> | 2020-08-19 15:32:44 +0300 |
commit | 222070ec5eed7fc49e44260c192dc1ec781eafd5 (patch) | |
tree | 1b227672d64469e9b7cb740f55e8f8ea2124f53d | |
parent | 44bfc1e0a95c50af4121695aaefc02e6642f938d (diff) | |
download | eventlet-223-threading-join.tar.gz |
Issue #223: Fix threading monkey-patching on py3.4223-threading-join
Fix the monkey-patching of the threading module on Python 3.4. Instead
of removing the thread state lock, patch the _bootstrap_inner() method
to release it.
-rw-r--r-- | tests/isolated/patched_threading_join.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/isolated/patched_threading_join.py b/tests/isolated/patched_threading_join.py new file mode 100644 index 0000000..4361f52 --- /dev/null +++ b/tests/isolated/patched_threading_join.py @@ -0,0 +1,23 @@ +# Issue #223: test threading.Thread.join with monkey-patching +import eventlet + +# no standard tests in this file, ignore +__test__ = False + + +if __name__ == '__main__': + eventlet.monkey_patch() + + import threading + import time + + sleeper = threading.Thread(target=time.sleep, args=(1,)) + start = time.time() + sleeper.start() + sleeper.join() + dt = time.time() - start + + if dt < 1.0: + raise Exception("test failed: dt=%s" % dt) + + print('pass') |