Compare commits
3 Commits
f2ce4a3469
...
67f673bf36
Author | SHA1 | Date |
---|---|---|
Tyler Goodlet | 67f673bf36 | |
Tyler Goodlet | 3a105e2830 | |
Tyler Goodlet | a315f01acc |
|
@ -6,7 +6,6 @@ sync-opening a ``tractor.Context`` beforehand.
|
|||
|
||||
'''
|
||||
from itertools import count
|
||||
import math
|
||||
import platform
|
||||
from pprint import pformat
|
||||
from typing import (
|
||||
|
@ -873,7 +872,7 @@ def test_one_end_stream_not_opened(
|
|||
enable_modules=[__name__],
|
||||
)
|
||||
|
||||
with trio.fail_after(0.8):
|
||||
with trio.fail_after(1):
|
||||
async with portal.open_context(
|
||||
entrypoint,
|
||||
) as (ctx, sent):
|
||||
|
@ -1060,17 +1059,7 @@ def test_maybe_allow_overruns_stream(
|
|||
loglevel=loglevel,
|
||||
debug_mode=debug_mode,
|
||||
)
|
||||
|
||||
# stream-sequence batch info with send delay to determine
|
||||
# approx timeout determining whether test has hung.
|
||||
total_batches: int = 2
|
||||
num_items: int = 10
|
||||
seq = list(range(num_items))
|
||||
parent_send_delay: float = 0.16
|
||||
timeout: float = math.ceil(
|
||||
total_batches * num_items * parent_send_delay
|
||||
)
|
||||
with trio.fail_after(timeout):
|
||||
seq = list(range(10))
|
||||
async with portal.open_context(
|
||||
echo_back_sequence,
|
||||
seq=seq,
|
||||
|
@ -1086,6 +1075,7 @@ def test_maybe_allow_overruns_stream(
|
|||
allow_overruns=(allow_overruns_side in {'parent', 'both'}),
|
||||
) as stream:
|
||||
|
||||
total_batches: int = 2
|
||||
for _ in range(total_batches):
|
||||
for msg in seq:
|
||||
# print(f'root tx {msg}')
|
||||
|
@ -1094,7 +1084,7 @@ def test_maybe_allow_overruns_stream(
|
|||
# NOTE: we make the parent slightly
|
||||
# slower, when it is slow, to make sure
|
||||
# that in the overruns everywhere case
|
||||
await trio.sleep(parent_send_delay)
|
||||
await trio.sleep(0.16)
|
||||
|
||||
batch = []
|
||||
async for msg in stream:
|
||||
|
|
|
@ -438,8 +438,8 @@ _ctxvar_MsgCodec: MsgCodec = RunVar(
|
|||
'msgspec_codec',
|
||||
|
||||
# TODO: move this to our new `Msg`-spec!
|
||||
default=_def_msgspec_codec,
|
||||
# default=_def_tractor_codec,
|
||||
# default=_def_msgspec_codec,
|
||||
default=_def_tractor_codec,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue