aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/bindings/test_openssl.py
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-01-24 19:04:01 +0000
committerAlex Stapleton <alexs@prol.etari.at>2014-01-24 19:08:36 +0000
commit29446cd8315985680fd2af0d0137c3d1c4c2a4a1 (patch)
tree2836f93460bdb2375b7439c8b59966bd2a14a03c /tests/hazmat/bindings/test_openssl.py
parent5fb7eb442d56642f201ba016fa5e8f99943f0bfe (diff)
downloadcryptography-29446cd8315985680fd2af0d0137c3d1c4c2a4a1.tar.gz
cryptography-29446cd8315985680fd2af0d0137c3d1c4c2a4a1.tar.bz2
cryptography-29446cd8315985680fd2af0d0137c3d1c4c2a4a1.zip
Remove the contenious test of contention
Diffstat (limited to 'tests/hazmat/bindings/test_openssl.py')
-rw-r--r--tests/hazmat/bindings/test_openssl.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/hazmat/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py
index 43a07760..35eb7e8d 100644
--- a/tests/hazmat/bindings/test_openssl.py
+++ b/tests/hazmat/bindings/test_openssl.py
@@ -11,9 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import threading
-import time
-
import pytest
from cryptography.hazmat.bindings.openssl.binding import Binding
@@ -99,46 +96,3 @@ class TestOpenSSL(object):
# unlocked
assert lock.acquire(False)
lock.release()
-
- def test_crypto_lock_mutex(self):
- b = Binding()
- b.init_static_locks()
-
- # make sure whatever locking system we end up with actually acts
- # like a mutex.
-
- self._shared_value = 0
-
- def critical_loop():
- for i in range(10):
- b.lib.CRYPTO_lock(
- b.lib.CRYPTO_LOCK | b.lib.CRYPTO_READ,
- b.lib.CRYPTO_LOCK_SSL,
- b.ffi.NULL,
- 0
- )
-
- assert self._shared_value == 0
- self._shared_value += 1
- time.sleep(0.01)
- assert self._shared_value == 1
- self._shared_value = 0
-
- b.lib.CRYPTO_lock(
- b.lib.CRYPTO_UNLOCK | b.lib.CRYPTO_READ,
- b.lib.CRYPTO_LOCK_SSL,
- b.ffi.NULL,
- 0
- )
-
- threads = []
- for x in range(10):
- t = threading.Thread(target=critical_loop)
- t.start()
- threads.append(t)
-
- while threads:
- for t in threads:
- t.join(0.1)
- if not t.is_alive():
- threads.remove(t)