gleb-sevruk / pycrunch-engine

NCrunch inspired tool for continuous testing Python
https://pycrunch.com
Other
57 stars 8 forks source link

Python3.11 cannot start engine: `Passing coroutines is forbidden, use tasks explicitly` #96

Closed antondeliverect closed 10 months ago

antondeliverect commented 11 months ago

I'm using python 3.11.4 & M1 mac. Upon starting of pycrunch engine, I get exception.

Full error trace:

    To enable it back, please set `engine->enable-web-ui` in `.pycrunch-config.yaml` to true
[44959] 2023-08-31 11:00:40,222 - pycrunch.execution_watchdog.connection_watchdog - INFO - started ConnectionWatchdog->watch_client_connection_loop
======== Running on http://0.0.0.0:57598 ========
(Press CTRL+C to quit)
[44959] 2023-08-31 11:00:40,951 - pycrunch.execution_watchdog.connection_watchdog - INFO - ConnectionWatchdog->connection_established
[44959] 2023-08-31 11:00:40,952 - engineio.server - ERROR - connect async handler error
Traceback (most recent call last):
  File ".../venv/lib/python3.11/site-packages/engineio/asyncio_server.py", line 449, in _trigger_event
    ret = await self.handlers[event](*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../venv/lib/python3.11/site-packages/socketio/asyncio_server.py", line 522, in _handle_eio_connect
    return await self._handle_connect(sid, '/')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../venv/lib/python3.11/site-packages/socketio/asyncio_server.py", line 421, in _handle_connect
    success = await self._trigger_event('connect', namespace, sid,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../venv/lib/python3.11/site-packages/socketio/asyncio_server.py", line 504, in _trigger_event
    ret = await self.handlers[namespace][event](*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../venv/lib/python3.11/site-packages/pycrunch/api/socket_handlers.py", line 107, in connect
    await pipe.push(
  File ".../venv/lib/python3.11/site-packages/pycrunch/api/shared.py", line 33, in push
    await shield(sio().emit('event',
  File ".../venv/lib/python3.11/site-packages/socketio/asyncio_server.py", line 134, in emit
    await self.manager.emit(event, data, namespace, room=room,
  File ".../venv/lib/python3.11/site-packages/socketio/asyncio_manager.py", line 33, in emit
    await asyncio.wait(tasks)
  File "/Users/anton/.pyenv/versions/3.11.4/lib/python3.11/asyncio/tasks.py", line 415, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
[44959] 2023-08-31 11:00:40,954 - engineio.server - WARNING - Application rejected connection
/Users/anton/.pyenv/versions/3.11.4/lib/python3.11/asyncio/base_events.py:1923: RuntimeWarning: coroutine 'AsyncServer._emit_internal' was never awaited
  handle = None  # Needed to break cycles when an exception occurs.
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
gleb-sevruk commented 10 months ago

I will investigate the issue and provide an update shortly

gleb-sevruk commented 10 months ago

After initial investigation, it turns out Socket.IO version used in both the engine and PyCharm plugin is outdated (2015-like); I'm working now on updating dependencies .

antondeliverect commented 10 months ago

Ty for quick update & help with a fix! 🥹🥹 Looking forward to use this plugin again

gleb-sevruk commented 10 months ago

The update has been pushed to the IntelliJ Plugin Store and should be available within a day or two.

Version 1.6.0 of the pycrunch-engine package is now live on PyPI.

Note: We've thrown backward compatibility out the window! Versions 1.5.x and 1.6.x are now not compatible. To make things work, you need both the plugin and the engine to be at version 1.6.0.

If the update is slower than a snail on a treadmill, here's the plugin package for PyCharm: pycrunch-intellij-connector-1.6.0.zip

gleb-sevruk commented 10 months ago

New version is released https://plugins.jetbrains.com/plugin/13264-pycrunch--live-testing/versions/stable/395555

Please update both plugin and the engine.

pip install --upgrade pycrunch-engine