diff --git a/tests/discovery/test_multi_program.py b/tests/discovery/test_multi_program.py index 7b294a15..1030de6e 100644 --- a/tests/discovery/test_multi_program.py +++ b/tests/discovery/test_multi_program.py @@ -123,10 +123,10 @@ def test_register_duplicate_name( '`wait_for_actor` returned' ) assert ( - (portal.channel.aid.name, portal.channel.aid.uuid) + portal.channel.aid.uid in ( - (p2.channel.aid.name, p2.channel.aid.uuid), - (p1.channel.aid.name, p1.channel.aid.uuid), + p2.channel.aid.uid, + p1.channel.aid.uid, ) ) @@ -249,11 +249,11 @@ def test_dup_name_cancel_cascade_escalates_to_hard_kill( # have last-wins semantics under same-name). async with tractor.wait_for_actor('doggy') as portal: expected_uids = { - (p.channel.aid.name, p.channel.aid.uuid) + p.channel.aid.uid for p in portals } assert ( - (portal.channel.aid.name, portal.channel.aid.uuid) + portal.channel.aid.uid in expected_uids ) diff --git a/tests/msg/test_ext_types_msgspec.py b/tests/msg/test_ext_types_msgspec.py index 2f1f8231..f22e0f18 100644 --- a/tests/msg/test_ext_types_msgspec.py +++ b/tests/msg/test_ext_types_msgspec.py @@ -64,7 +64,7 @@ def enc_nsp(obj: Any) -> Any: ) uid: tuple[str, str]|None = ( None if not actor - else (actor.aid.name, actor.aid.uuid) + else actor.aid.uid ) print(f'{uid} ENC HOOK') @@ -100,7 +100,7 @@ def dec_nsp( ) uid: tuple[str, str]|None = ( None if not actor - else (actor.aid.name, actor.aid.uuid) + else actor.aid.uid ) print( f'{uid}\n' @@ -426,7 +426,7 @@ async def send_back_values( ''' _aid = tractor.current_actor().aid - uid: tuple = (_aid.name, _aid.uuid) + uid: tuple = _aid.uid # 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 aac4e32a..c04bf130 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.aid.name, ctx.chan.aid.uuid)}') + print(f'setting sub to {new_subs} for {ctx.chan.aid.uid}') # remove old subs for sub in remove: @@ -85,7 +85,7 @@ async def consumer( ) -> None: _aid = tractor.current_actor().aid - uid = (_aid.name, _aid.uuid) + uid = _aid.uid 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 3eedd64f..8ef85426 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.aid.name, actor.aid.uuid) + uid: tuple = actor.aid.uid _ctxc: ContextCancelled|None = None if ( @@ -712,9 +712,9 @@ async def test_parent_exits_ctx_after_child_enters_stream( assert ( ctxc.canceller == - (current_actor().aid.name, current_actor().aid.uuid) + current_actor().aid.uid == - (root.aid.name, root.aid.uuid) + root.aid.uid ) # 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().aid.name, current_actor().aid.uuid) + assert tuple(res.canceller) == current_actor().aid.uid else: print(f'RX ROOT SIDE RESULT {res}') diff --git a/tests/test_infected_asyncio.py b/tests/test_infected_asyncio.py index 5bf12bb3..bdb1b852 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.aid.name, ctx._actor.aid.uuid))}.file' + tmp_file: Path = tmp_path / f'{" ".join(ctx._actor.aid.uid)}.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.aid.name, ctx.chan.aid.uuid) + assert ctxc.canceller == ctx.chan.aid.uid raise except trio.TooSlowError: @@ -1300,7 +1300,7 @@ async def caching_ep( }, # lock around current actor task access - key=(tractor.current_actor().aid.name, tractor.current_actor().aid.uuid), + key=tractor.current_actor().aid.uid, ) as (cache_hit, (clients, chan)), ): diff --git a/tests/test_spawning.py b/tests/test_spawning.py index 0e1bacfc..b6128b96 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.aid.name, portal.channel.aid.uuid) + portal.channel.aid.uid in tractor.current_actor().ipc_server._peers ) diff --git a/tractor/_exceptions.py b/tractor/_exceptions.py index a4007bff..ab3043c5 100644 --- a/tractor/_exceptions.py +++ b/tractor/_exceptions.py @@ -1223,7 +1223,7 @@ def pack_error( str, str | tuple[str, str] ] = {} - our_uid: tuple = (current_actor().aid.name, current_actor().aid.uuid) + our_uid: tuple[str, str] = current_actor().aid.uid if ( isinstance(exc, RemoteActorError) diff --git a/tractor/_streaming.py b/tractor/_streaming.py index 01db098f..adc77dcd 100644 --- a/tractor/_streaming.py +++ b/tractor/_streaming.py @@ -418,7 +418,7 @@ class MsgStream(trio.abc.Channel): # it can't traverse the transport. log.warning( f'Stream was already destroyed?\n' - f'actor: {(ctx.chan.aid.name, ctx.chan.aid.uuid)}\n' + f'actor: {ctx.chan.aid.uid}\n' f'ctx id: {ctx.cid}' ) drained.append(re) @@ -823,7 +823,7 @@ async def open_stream_from_ctx( except KeyError: log.warning( f'Stream was already destroyed?\n' - f'actor: {(ctx.chan.aid.name, ctx.chan.aid.uuid)}\n' + f'actor: {ctx.chan.aid.uid}\n' f'ctx id: {ctx.cid}' ) diff --git a/tractor/devx/debug/_sync.py b/tractor/devx/debug/_sync.py index 7847495d..9e1a6395 100644 --- a/tractor/devx/debug/_sync.py +++ b/tractor/devx/debug/_sync.py @@ -92,11 +92,11 @@ async def maybe_wait_for_debugger( # tearing down. ctx_in_debug: Context|None = Lock.ctx_in_debug in_debug: tuple[str, str]|None = ( - (ctx_in_debug.chan.aid.name, ctx_in_debug.chan.aid.uuid) + ctx_in_debug.chan.aid.uid if ctx_in_debug else None ) - if in_debug == (current_actor().aid.name, current_actor().aid.uuid): + if in_debug == current_actor().aid.uid: log.debug( msg + diff --git a/tractor/experimental/_pubsub.py b/tractor/experimental/_pubsub.py index 08760200..c9bf13d6 100644 --- a/tractor/experimental/_pubsub.py +++ b/tractor/experimental/_pubsub.py @@ -129,7 +129,7 @@ def modify_subs( Effectively a symbol subscription api. """ - log.info(f"{(ctx.chan.aid.name, ctx.chan.aid.uuid)} changed subscription to {topics}") + log.info(f"{ctx.chan.aid.uid} changed subscription to {topics}") # update map from each symbol to requesting client's chan for topic in topics: diff --git a/tractor/msg/_ops.py b/tractor/msg/_ops.py index c341f092..a134306f 100644 --- a/tractor/msg/_ops.py +++ b/tractor/msg/_ops.py @@ -345,9 +345,9 @@ class PldRx(Struct): exc=mte, cid=msg.cid, src_uid=( - (ipc.chan.aid.name, ipc.chan.aid.uuid) + ipc.chan.aid.uid if not is_started_send_side - else (ipc._actor.aid.name, ipc._actor.aid.uuid) + else ipc._actor.aid.uid ), ) mte._ipc_msg = err_msg @@ -711,7 +711,7 @@ async def drain_to_final_msg( 'Cancelling `MsgStream` drain since ' f'{reason}\n' f'\n' - f'<= {(ctx.chan.aid.name, ctx.chan.aid.uuid)}\n' + f'<= {ctx.chan.aid.uid}\n' f' |_{ctx._nsf}()\n' f'\n' f'=> {ctx._task}\n' @@ -726,7 +726,7 @@ async def drain_to_final_msg( else: report: str = ( 'Ignoring "yield" msg during `ctx.result()` drain..\n' - f'<= {(ctx.chan.aid.name, ctx.chan.aid.uuid)}\n' + f'<= {ctx.chan.aid.uid}\n' f' |_{ctx._nsf}()\n\n' f'=> {ctx._task}\n' f' |_{ctx._stream}\n\n'