Of course, increase the timeout for windows..

context_caching
Tyler Goodlet 2021-12-15 17:50:47 -05:00
parent 26394dd8df
commit 9b1d8bf7b0
1 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@ Async context manager cache api testing: ``trionics.maybe_open_context():``
''' '''
from contextlib import asynccontextmanager as acm from contextlib import asynccontextmanager as acm
import platform
from typing import Awaitable from typing import Awaitable
import trio import trio
@ -65,6 +66,8 @@ def test_open_local_sub_to_stream():
N local tasks using ``trionics.maybe_open_context():``. N local tasks using ``trionics.maybe_open_context():``.
''' '''
timeout = 3 if platform.system() != "Windows" else 10
async def main(): async def main():
full = list(range(1000)) full = list(range(1000))
@ -92,7 +95,7 @@ def test_open_local_sub_to_stream():
# TODO: turns out this isn't multi-task entrant XD # TODO: turns out this isn't multi-task entrant XD
# We probably need an indepotent entry semantic? # We probably need an indepotent entry semantic?
with trio.fail_after(3): with trio.fail_after(timeout):
async with tractor.open_root_actor(): async with tractor.open_root_actor():
async with ( async with (
trio.open_nursery() as nurse, trio.open_nursery() as nurse,