diff --git a/tests/discovery/test_multi_program.py b/tests/discovery/test_multi_program.py index 47e50e53..7b294a15 100644 --- a/tests/discovery/test_multi_program.py +++ b/tests/discovery/test_multi_program.py @@ -122,7 +122,13 @@ def test_register_duplicate_name( 'test_register_duplicate_name: ' '`wait_for_actor` returned' ) - assert portal.channel.uid in (p2.channel.uid, p1.channel.uid) + assert ( + (portal.channel.aid.name, portal.channel.aid.uuid) + in ( + (p2.channel.aid.name, p2.channel.aid.uuid), + (p1.channel.aid.name, p1.channel.aid.uuid), + ) + ) log.cancel( 'test_register_duplicate_name: ' @@ -242,8 +248,14 @@ def test_dup_name_cancel_cascade_escalates_to_hard_kill( # name; doesn't matter which one (registrar will # have last-wins semantics under same-name). async with tractor.wait_for_actor('doggy') as portal: - expected_uids = {p.channel.uid for p in portals} - assert portal.channel.uid in expected_uids + expected_uids = { + (p.channel.aid.name, p.channel.aid.uuid) + for p in portals + } + assert ( + (portal.channel.aid.name, portal.channel.aid.uuid) + in expected_uids + ) # critical section: this MUST return within # `fail_after_s` even when one or more cancel-RPC diff --git a/tests/msg/test_ext_types_msgspec.py b/tests/msg/test_ext_types_msgspec.py index f07d375c..2f1f8231 100644 --- a/tests/msg/test_ext_types_msgspec.py +++ b/tests/msg/test_ext_types_msgspec.py @@ -62,7 +62,10 @@ def enc_nsp(obj: Any) -> Any: actor: Actor = tractor.current_actor( err_on_no_runtime=False, ) - uid: tuple[str, str]|None = None if not actor else actor.uid + uid: tuple[str, str]|None = ( + None if not actor + else (actor.aid.name, actor.aid.uuid) + ) print(f'{uid} ENC HOOK') match obj: @@ -95,7 +98,10 @@ def dec_nsp( actor: Actor = tractor.current_actor( err_on_no_runtime=False, ) - uid: tuple[str, str]|None = None if not actor else actor.uid + uid: tuple[str, str]|None = ( + None if not actor + else (actor.aid.name, actor.aid.uuid) + ) print( f'{uid}\n' 'CUSTOM DECODE\n' @@ -419,7 +425,8 @@ async def send_back_values( and ensure we can round trip a func ref with our parent. ''' - uid: tuple = tractor.current_actor().uid + _aid = tractor.current_actor().aid + uid: tuple = (_aid.name, _aid.uuid) # init state in sub-actor should be default chk_codec_applied( diff --git a/tests/test_advanced_streaming.py b/tests/test_advanced_streaming.py index 9b1a476f..aac4e32a 100644 --- a/tests/test_advanced_streaming.py +++ b/tests/test_advanced_streaming.py @@ -69,7 +69,7 @@ async def subscribe( new_subs = set(new_subs) remove = new_subs - _registry.keys() - print(f'setting sub to {new_subs} for {ctx.chan.uid}') + print(f'setting sub to {new_subs} for {(ctx.chan.aid.name, ctx.chan.aid.uuid)}') # remove old subs for sub in remove: @@ -84,7 +84,8 @@ async def consumer( subs: list[str], ) -> None: - uid = tractor.current_actor().uid + _aid = tractor.current_actor().aid + uid = (_aid.name, _aid.uuid) async with tractor.wait_for_actor('publisher') as portal: async with portal.open_context(subscribe) as (ctx, first): diff --git a/tests/test_context_stream_semantics.py b/tests/test_context_stream_semantics.py index 4e23dcae..3eedd64f 100644 --- a/tests/test_context_stream_semantics.py +++ b/tests/test_context_stream_semantics.py @@ -311,7 +311,7 @@ def test_parent_cancels( ctx: Context, ) -> None: actor: Actor = current_actor() - uid: tuple = actor.uid + uid: tuple = (actor.aid.name, actor.aid.uuid) _ctxc: ContextCancelled|None = None if ( @@ -712,9 +712,9 @@ async def test_parent_exits_ctx_after_child_enters_stream( assert ( ctxc.canceller == - current_actor().uid + (current_actor().aid.name, current_actor().aid.uuid) == - root.uid + (root.aid.name, root.aid.uuid) ) # channel should still be up @@ -1219,7 +1219,7 @@ def test_maybe_allow_overruns_stream( if cancel_ctx: assert isinstance(res, ContextCancelled) - assert tuple(res.canceller) == current_actor().uid + assert tuple(res.canceller) == (current_actor().aid.name, current_actor().aid.uuid) else: print(f'RX ROOT SIDE RESULT {res}') diff --git a/tests/test_infected_asyncio.py b/tests/test_infected_asyncio.py index a751e010..5bf12bb3 100644 --- a/tests/test_infected_asyncio.py +++ b/tests/test_infected_asyncio.py @@ -956,7 +956,7 @@ async def manage_file( ''' tmp_path: Path = Path(tmp_path_str) - tmp_file: Path = tmp_path / f'{" ".join(ctx._actor.uid)}.file' + tmp_file: Path = tmp_path / f'{" ".join((ctx._actor.aid.name, ctx._actor.aid.uuid))}.file' # create a the tmp file and tell the parent where it's at assert not tmp_file.is_file() @@ -1180,7 +1180,7 @@ def test_sigint_closes_lifetime_stack( ): await ctx.wait_for_result() except tractor.ContextCancelled as ctxc: - assert ctxc.canceller == ctx.chan.uid + assert ctxc.canceller == (ctx.chan.aid.name, ctx.chan.aid.uuid) raise except trio.TooSlowError: @@ -1300,7 +1300,7 @@ async def caching_ep( }, # lock around current actor task access - key=tractor.current_actor().uid, + key=(tractor.current_actor().aid.name, tractor.current_actor().aid.uuid), ) as (cache_hit, (clients, chan)), ): diff --git a/tests/test_local.py b/tests/test_local.py index 765ff796..b585651c 100644 --- a/tests/test_local.py +++ b/tests/test_local.py @@ -34,7 +34,7 @@ async def test_self_is_registered(reg_addr): assert actor.is_registrar with trio.fail_after(0.2): async with tractor.wait_for_actor('root') as portal: - assert portal.channel.uid[0] == 'root' + assert portal.channel.aid.name == 'root' @tractor_test diff --git a/tests/test_spawning.py b/tests/test_spawning.py index d12c9b28..0e1bacfc 100644 --- a/tests/test_spawning.py +++ b/tests/test_spawning.py @@ -65,7 +65,7 @@ async def spawn( assert len(an._children) == 1 assert ( - portal.channel.uid + (portal.channel.aid.name, portal.channel.aid.uuid) in tractor.current_actor().ipc_server._peers )