diff options
| author | Omer Katz <omer.drow@gmail.com> | 2019-03-19 09:53:06 +0200 |
|---|---|---|
| committer | Omer Katz <omer.drow@gmail.com> | 2019-03-19 09:53:06 +0200 |
| commit | d760002e256f0a488c436d0d57e5896adb162d7b (patch) | |
| tree | e5ccfa63a37e0df730089ee19f761ed486edf84c /t | |
| parent | f08e2106eed9878e73d7d553473226d9c74c7d3d (diff) | |
| download | py-amqp-threadsafty.tar.gz | |
Added a test that proves that amqp is not threadsafe.threadsafty
Diffstat (limited to 't')
| -rw-r--r-- | t/integration/test_rmq.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/integration/test_rmq.py b/t/integration/test_rmq.py index e5f0496..71ecaf3 100644 --- a/t/integration/test_rmq.py +++ b/t/integration/test_rmq.py @@ -1,6 +1,8 @@ from __future__ import absolute_import, unicode_literals import os +import threading +import logging import pytest @@ -146,3 +148,21 @@ class test_rabbitmq_operations(): queue='py-amqp-unittest', ) assert msg is None + + +def test_threadsafty(caplog, connection): + caplog.set_level(logging.DEBUG) + connection.connect() + + def worker(): + connection.channel() + + threads = [threading.Thread(target=worker) for _ in range(2)] + + for t in threads: + t.start() + + for t in threads: + t.join(timeout=30) + + connection.close() |
