forked from goodboy/tractor
1
0
Fork 0
tractor/tests
Tyler Goodlet 38d03858d7 Fix `asyncio`-task-sync and error propagation
This fixes an previously undetected bug where if an
`.open_channel_from()` spawned task errored the error would not be
propagated to the `trio` side and instead would fail silently with
a console log error. What was most odd is that it only seems easy to
trigger when you put a slight task sleep before the error is raised
(:eyeroll:). This patch adds a few things to address this and just in
general improve iter-task lifetime syncing:

- add `LinkedTaskChannel._trio_exited: bool` a flag set from the `trio`
  side when the channel block exits.
- add a `wait_on_aio_task: bool` flag to `translate_aio_errors` which
  toggles whether to wait the `asyncio` task termination event on exit.
- cancel the `asyncio` task if the trio side has ended, when
  `._trio_exited == True`.
- always close the `trio` mem channel when the task exits such that
  the `asyncio` side can error on any next `.send()` call.
2022-07-14 16:35:41 -04:00
..
conftest.py Properly set console logging in test suite 2021-12-07 13:17:10 -05:00
test_2way.py Move context-streaming operational tests into one mod 2021-12-06 16:45:44 -05:00
test_advanced_streaming.py Increase some timeouts for windows 2022-01-21 12:20:06 -05:00
test_cancellation.py Increase some timeouts for windows 2022-01-21 12:20:06 -05:00
test_child_manages_service_nursery.py Add a new "trioisms" test mod for tracking `trio` wishlist behaviour 2022-04-12 13:05:56 -04:00
test_clustering.py Enable bp on clustering test 2021-12-05 20:02:55 -05:00
test_context_stream_semantics.py Adjust cancelled test to expect raised overrun error 2021-12-16 19:59:10 -05:00
test_debugger.py Increase debugger poll delay back to prior value 2021-12-10 11:54:27 -05:00
test_discovery.py Pack tuple keys as . delim strs in registry tests 2022-02-15 08:48:07 -05:00
test_docs_examples.py Plan asyncio test set 2021-12-17 09:38:04 -05:00
test_infected_asyncio.py Fix `asyncio`-task-sync and error propagation 2022-07-14 16:35:41 -04:00
test_local.py Mostly drop run from local tests 2021-05-07 11:21:40 -04:00
test_multi_program.py Drop run from multi prog tests 2021-05-07 11:21:40 -04:00
test_pubsub.py Better idea: start a `tractor.experimental` subpkg 2022-01-29 14:03:55 -05:00
test_resource_cache.py Parameterize over cache keying methods: kwargs and "key" 2021-12-16 18:02:03 -05:00
test_rpc.py Drop lingering rpc_module_paths refs 2021-05-07 11:21:40 -04:00
test_spawning.py Increase timeout, windows... 2021-11-20 13:08:19 -05:00
test_streaming.py One more increase for py3.10 2022-01-21 12:20:06 -05:00
test_task_broadcasting.py Slight delay to avoid flaky bcast race 2021-12-06 12:17:37 -05:00
test_trioisms.py Add a new "trioisms" test mod for tracking `trio` wishlist behaviour 2022-04-12 13:05:56 -04:00