Cleaning up environment Preparing virtual environment Installing latest version of the repository Processing /tmp/tmp.7wSGI2TT47/repo Collecting pyyaml Using cached PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl (630 kB) Collecting redis Using cached redis-3.5.3-py2.py3-none-any.whl (72 kB) Collecting requests Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB) Collecting croniter Using cached croniter-1.0.8-py2.py3-none-any.whl (13 kB) Collecting sqlalchemy Using cached SQLAlchemy-1.3.23-cp39-cp39-manylinux2010_x86_64.whl (1.3 MB) Collecting websockets Using cached websockets-8.1.tar.gz (58 kB) Collecting websocket-client Using cached websocket_client-0.58.0-py2.py3-none-any.whl (61 kB) Collecting wheel Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB) Collecting zeroconf>=0.27.0 Using cached zeroconf-0.28.8-py3-none-any.whl (55 kB) Collecting tz Using cached tz-0.2.2-py3-none-any.whl (12 kB) Collecting python-dateutil Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB) Collecting cryptography Using cached cryptography-3.4.6-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB) Collecting pyjwt Using cached PyJWT-2.0.1-py3-none-any.whl (15 kB) Collecting flask Using cached Flask-1.1.2-py2.py3-none-any.whl (94 kB) Collecting frozendict Using cached frozendict-1.2.tar.gz (2.6 kB) Collecting bcrypt Using cached bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl (63 kB) Collecting urllib3<1.27,>=1.21.1 Using cached urllib3-1.26.3-py2.py3-none-any.whl (137 kB) Collecting chardet<5,>=3.0.2 Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB) Collecting certifi>=2017.4.17 Using cached certifi-2020.12.5-py2.py3-none-any.whl (147 kB) Collecting idna<3,>=2.5 Using cached idna-2.10-py2.py3-none-any.whl (58 kB) Collecting future Using cached future-0.18.2.tar.gz (829 kB) Collecting natsort Using cached natsort-7.1.1-py3-none-any.whl (35 kB) Collecting six Using cached six-1.15.0-py2.py3-none-any.whl (10 kB) Collecting ifaddr>=0.1.7 Using cached ifaddr-0.1.7-py2.py3-none-any.whl (10 kB) Collecting cffi>=1.12 Using cached cffi-1.14.5-cp39-cp39-manylinux1_x86_64.whl (406 kB) Collecting itsdangerous>=0.24 Using cached itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB) Collecting Jinja2>=2.10.1 Using cached Jinja2-2.11.3-py2.py3-none-any.whl (125 kB) Collecting Werkzeug>=0.15 Using cached Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB) Collecting click>=5.1 Using cached click-7.1.2-py2.py3-none-any.whl (82 kB) Collecting pycparser Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB) Collecting MarkupSafe>=0.23 Using cached MarkupSafe-1.1.1-cp39-cp39-manylinux2010_x86_64.whl (32 kB) Using legacy 'setup.py install' for platypush, since package 'wheel' is not installed. Using legacy 'setup.py install' for websockets, since package 'wheel' is not installed. Using legacy 'setup.py install' for frozendict, since package 'wheel' is not installed. Using legacy 'setup.py install' for future, since package 'wheel' is not installed. Installing collected packages: pyyaml, redis, urllib3, chardet, certifi, idna, requests, future, natsort, six, python-dateutil, croniter, sqlalchemy, websockets, websocket-client, wheel, ifaddr, zeroconf, tz, pycparser, cffi, cryptography, pyjwt, itsdangerous, MarkupSafe, Jinja2, Werkzeug, click, flask, frozendict, bcrypt, platypush Running setup.py install for future: started Running setup.py install for future: finished with status 'done' Running setup.py install for websockets: started Running setup.py install for websockets: finished with status 'done' Running setup.py install for frozendict: started Running setup.py install for frozendict: finished with status 'done' Running setup.py install for platypush: started Running setup.py install for platypush: finished with status 'done' Successfully installed Jinja2-2.11.3 MarkupSafe-1.1.1 Werkzeug-1.0.1 bcrypt-3.2.0 certifi-2020.12.5 cffi-1.14.5 chardet-4.0.0 click-7.1.2 croniter-1.0.8 cryptography-3.4.6 flask-1.1.2 frozendict-1.2 future-0.18.2 idna-2.10 ifaddr-0.1.7 itsdangerous-1.1.0 natsort-7.1.1 platypush-0.20.3 pycparser-2.20 pyjwt-2.0.1 python-dateutil-2.8.1 pyyaml-5.4.1 redis-3.5.3 requests-2.25.1 six-1.15.0 sqlalchemy-1.3.23 tz-0.2.2 urllib3-1.26.3 websocket-client-0.58.0 websockets-8.1 wheel-0.36.2 zeroconf-0.28.8 Running tests ============================= test session starts ============================== platform linux -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 rootdir: /tmp/tmp.7wSGI2TT47/repo collected 8 items tests/test_event_parse.py . [ 12%] tests/test_http.py ..... [ 75%] tests/test_procedure.py FF [100%] =================================== FAILURES =================================== _____________________________ test_procedure_call ______________________________ tmp_file = def test_procedure_call(tmp_file): """ Test the result of a procedure invoked directly over HTTP. """ output_text = 'Procedure test' > send_request( action='procedure.write_file', args={ 'file': tmp_file.name, 'content': output_text, }) tests/test_procedure.py:37: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/utils.py:52: in send_request response = requests.post( /usr/lib/python3.9/site-packages/requests/api.py:119: in post return request('post', url, data=data, json=json, **kwargs) /usr/lib/python3.9/site-packages/requests/api.py:61: in request return session.request(method=method, url=url, **kwargs) /usr/lib/python3.9/site-packages/requests/sessions.py:542: in request resp = self.send(prep, **send_kwargs) /usr/lib/python3.9/site-packages/requests/sessions.py:655: in send r = adapter.send(request, **kwargs) /usr/lib/python3.9/site-packages/requests/adapters.py:439: in send resp = conn.urlopen( /usr/lib/python3.9/site-packages/urllib3/connectionpool.py:699: in urlopen httplib_response = self._make_request( /usr/lib/python3.9/site-packages/urllib3/connectionpool.py:445: in _make_request six.raise_from(e, None) :3: in raise_from ??? /usr/lib/python3.9/site-packages/urllib3/connectionpool.py:440: in _make_request httplib_response = conn.getresponse() /usr/lib/python3.9/http/client.py:1347: in getresponse response.begin() /usr/lib/python3.9/http/client.py:307: in begin version, status, reason = self._read_status() /usr/lib/python3.9/http/client.py:268: in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") /usr/lib/python3.9/socket.py:704: in readinto return self._sock.recv_into(b) platypush/utils/__init__.py:126: in _sighandler on_timeout() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > def _f(): raise TimeoutException(msg) E tests.utils.TimeoutException: Receiver response timed out tests/utils.py:86: TimeoutException ---------------------------- Captured stdout setup ----------------------------- INFO:werkzeug:127.0.0.1 - - [06/Mar/2021 16:22:05] "POST /register?redirect=http://localhost:8123/ HTTP/1.1" 302 - INFO:werkzeug:127.0.0.1 - - [06/Mar/2021 16:22:05] "GET /login?redirect=http://localhost:8123/ HTTP/1.1" 200 - ----------------------------- Captured stdout call ----------------------------- INFO:platypush:web:Received message on the HTTP backend: {'type': 'request', 'action': 'procedure.write_file', 'args': {'file': '/tmp/platypush-test-procedure-1cv2hz4f.txt', 'content': 'Procedure test'}} __________________________ test_procedure_from_event ___________________________ app = tmp_file = def test_procedure_from_event(app, tmp_file): """ Test the result of a procedure triggered by an event. """ output_text = 'Procedure from event test' event_type = 'platypush_test_procedure_from_event' # noinspection PyUnresolvedReferences app.bus.post(CustomEvent(subtype=event_type, file=tmp_file.name, content=output_text)) time.sleep(2) > check_file_content(expected_content=output_text, tmp_file=tmp_file) tests/test_procedure.py:56: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ expected_content = 'Procedure from event test' tmp_file = def check_file_content(expected_content: str, tmp_file): assert os.path.isfile(tmp_file.name), 'The expected output file was not created' with open(tmp_file.name, 'r') as f: content = f.read() > assert content == expected_content, 'The output file did not contain the expected text' E AssertionError: The output file did not contain the expected text E assert '' == 'Procedure from event test' E - Procedure from event test tests/test_procedure.py:29: AssertionError --------------------------- Captured stdout teardown --------------------------- INFO:root:Stopping Platypush test service INFO:root:Removing temporary db file /tmp/platypush-test-http.db ---------------------------- Captured log teardown ----------------------------- INFO root:conftest.py:25 Stopping Platypush test service INFO root:conftest.py:30 Removing temporary db file /tmp/platypush-test-http.db =========================== short test summary info ============================ FAILED tests/test_procedure.py::test_procedure_call - tests.utils.TimeoutExce... FAILED tests/test_procedure.py::test_procedure_from_event - AssertionError: T... ========================= 2 failed, 6 passed in 19.66s ========================= --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 1082, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/redis.py", line 93, in run self.logger.info('Redis backend terminated') Message: 'Redis backend terminated' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 1082, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/__init__.py", line 268, in _async_stop self.on_stop() File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/http/__init__.py", line 275, in on_stop self.logger.info('Received STOP event on HttpBackend') Message: 'Received STOP event on HttpBackend' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 1082, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/tmp/tmp.7wSGI2TT47/repo/platypush/bus/__init__.py", line 56, in executor self.on_message(msg) File "/tmp/tmp.7wSGI2TT47/repo/platypush/__init__.py", line 143, in _f logger.info('Received event: {}'.format(msg)) Message: 'Received event: {"type": "event", "target": "gitter", "origin": "gitter", "id": "691adefb547e3a2e6111078e05af7160", "_timestamp": 1615044138.0637214, "args": {"type": "platypush.message.event.zeroconf.ZeroconfServiceRemovedEvent", "service_event": "remove", "service_type": "_platypush-http._tcp.local.", "service_name": "gitter._platypush-http._tcp.local.", "service_info": null}}' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 1082, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/tmp/tmp.7wSGI2TT47/repo/tests/conftest.py", line 20, in Thread(target=lambda: app.run()).start() File "/tmp/tmp.7wSGI2TT47/repo/platypush/__init__.py", line 183, in run self.bus.poll() File "/tmp/tmp.7wSGI2TT47/repo/platypush/bus/__init__.py", line 87, in poll logger.info('Bus service stoppped') Message: 'Bus service stoppped' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 1082, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/__init__.py", line 268, in _async_stop self.on_stop() File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/http/__init__.py", line 275, in on_stop self.logger.info('Received STOP event on HttpBackend') Message: 'Received STOP event on HttpBackend' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 1082, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/__init__.py", line 268, in _async_stop self.on_stop() File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/http/__init__.py", line 293, in on_stop self.logger.info('HTTP server process terminated') Message: 'HTTP server process terminated' Arguments: () --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/__init__.py", line 1082, in emit stream.write(msg + self.terminator) ValueError: I/O operation on closed file. Call stack: File "/usr/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/__init__.py", line 268, in _async_stop self.on_stop() File "/tmp/tmp.7wSGI2TT47/repo/platypush/backend/http/__init__.py", line 293, in on_stop self.logger.info('HTTP server process terminated') Message: 'HTTP server process terminated' Arguments: () FAILED tests/test_procedure.py::test_procedure_call - tests.utils.TimeoutExce... FAILED tests/test_procedure.py::test_procedure_from_event - AssertionError: T... Status: FAILED Cleaning up environment