MockClock
0.0
2.0
FooMockClock
0.0
< hangs indefinitely >
Traceback (most recent call last):
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2813, in unrolled_run
assert isinstance(runner.clock, _core.MockClock)
AssertionError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/bogdan/wb/github/nucypher-async/t_new.py", line 185, in <module>
trio.run(main, clock=MockClock(autojump_threshold=0))
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2538, in run
timeout = gen.send(next_send)
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2951, in unrolled_run
raise TrioInternalError("internal error in Trio - please file a bug!") from exc
trio.TrioInternalError: internal error in Trio - please file a bug!
Exception ignored in: <coroutine object Runner.init at 0x106a26500>
Traceback (most recent call last):
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2156, in init
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1112, in __aexit__
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1288, in _nested_child_finished
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1252, in _add_exc
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 933, in _cancel
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 501, in recalculate
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1671, in _attempt_delivery_of_any_pending_cancel
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1644, in _attempt_abort
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_io_kqueue.py", line 162, in abort
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_io_kqueue.py", line 184, in abort
ValueError: I/O operation on closed kqueue object
Exception ignored in: <function Nursery.__del__ at 0x105b208b0>
Traceback (most recent call last):
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1486, in __del__
AssertionError:
Exception ignored in: <coroutine object main at 0x106a26570>
Traceback (most recent call last):
File "/Users/bogdan/wb/github/nucypher-async/t_new.py", line 180, in main
File "/Users/bogdan/wb/repos/trio/src/trio/_timeouts.py", line 111, in sleep
File "/Users/bogdan/wb/repos/trio/src/trio/_timeouts.py", line 91, in sleep_until
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 714, in __exit__
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 640, in _close
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2993, in current_task
RuntimeError: must be called from async context
Exception ignored in: <function Nursery.__del__ at 0x105b208b0>
Traceback (most recent call last):
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1486, in __del__
AssertionError:
bogdan@lair ~/w/g/nucypher-async (todo-party) [1]> python t_new.py
0.0
Traceback (most recent call last):
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2813, in unrolled_run
assert isinstance(runner.clock, _core.MockClock)
AssertionError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/bogdan/wb/github/nucypher-async/t_new.py", line 186, in <module>
trio.run(main, clock=MockClock(autojump_threshold=0))
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2538, in run
timeout = gen.send(next_send)
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2951, in unrolled_run
raise TrioInternalError("internal error in Trio - please file a bug!") from exc
trio.TrioInternalError: internal error in Trio - please file a bug!
Exception ignored in: <coroutine object Runner.init at 0x106ade500>
Traceback (most recent call last):
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2156, in init
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1112, in __aexit__
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1288, in _nested_child_finished
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1252, in _add_exc
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 933, in _cancel
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 501, in recalculate
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1671, in _attempt_delivery_of_any_pending_cancel
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1644, in _attempt_abort
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_io_kqueue.py", line 162, in abort
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_io_kqueue.py", line 184, in abort
ValueError: I/O operation on closed kqueue object
Exception ignored in: <function Nursery.__del__ at 0x105bd8820>
Traceback (most recent call last):
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1486, in __del__
AssertionError:
Exception ignored in: <coroutine object main at 0x106ade570>
Traceback (most recent call last):
File "/Users/bogdan/wb/github/nucypher-async/t_new.py", line 181, in main
File "/Users/bogdan/wb/repos/trio/src/trio/_timeouts.py", line 111, in sleep
File "/Users/bogdan/wb/repos/trio/src/trio/_timeouts.py", line 91, in sleep_until
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 714, in __exit__
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 640, in _close
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 2993, in current_task
RuntimeError: must be called from async context
Exception ignored in: <function Nursery.__del__ at 0x105bd8820>
Traceback (most recent call last):
File "/Users/bogdan/wb/repos/trio/src/trio/_core/_run.py", line 1486, in __del__
AssertionError:
Tested on 0.32 and the current
master.MRE:
Output:
I expected the second
run()to behave exactly the same as the first. What am I doing wrong?Also, if I copy-paste
trio.testing.MockClockverbatim to this script and use that, the execution crashes - may be related: