Open KholdStare opened 6 months ago
When using real timestamps for like 1709591365, the python event loop gets stuck forever in await:
1709591365
import pytest import asyncio from aiotools import VirtualClock @pytest.mark.asyncio async def test_stuck_forever(): clock = VirtualClock() clock.vtime = 1709591365 with lock.patch_loop(): await asyncio.sleep(1)
This is due to a behavior (bug?) in the BaseEventLoop https://github.com/python/cpython/issues/116342 .
The way I was able to solve it, was to override the eventloop _clock_resolution to 0.1 . Perhaps this should be added to the patch_loop implementation?
_clock_resolution
0.1
patch_loop
When using real timestamps for like
1709591365
, the python event loop gets stuck forever in await:This is due to a behavior (bug?) in the BaseEventLoop https://github.com/python/cpython/issues/116342 .
The way I was able to solve it, was to override the eventloop
_clock_resolution
to0.1
. Perhaps this should be added to thepatch_loop
implementation?