diff --git a/examples/debugging/shield_hang_in_sub.py b/examples/debugging/shield_hang_in_sub.py index bf045fe8..280757ea 100644 --- a/examples/debugging/shield_hang_in_sub.py +++ b/examples/debugging/shield_hang_in_sub.py @@ -3,6 +3,7 @@ Verify we can dump a `stackscope` tree on a hang. ''' import os +import platform import signal import trio @@ -31,13 +32,26 @@ async def main( from_test: bool = False, ) -> None: + if platform.system() != 'Darwin': + tpt = 'uds' + else: + # XXX, precisely we can't use pytest's tmp-path generation + # for tests.. apparently because: + # + # > The OSError: AF_UNIX path too long in macOS Python occurs + # > because the path to the Unix domain socket exceeds the + # > operating system's maximum path length limit (around 104 + # + # WHICH IS just, wtf hillarious XD + tpt = 'tcp' + async with ( tractor.open_nursery( debug_mode=True, enable_stack_on_sig=True, # maybe_enable_greenback=False, loglevel='devx', - enable_transports=['uds'], + enable_transports=[tpt], ) as an, ): ptl: tractor.Portal = await an.start_actor( diff --git a/examples/debugging/subactor_bp_in_ctx.py b/examples/debugging/subactor_bp_in_ctx.py index f55d2cd4..0ca7097f 100644 --- a/examples/debugging/subactor_bp_in_ctx.py +++ b/examples/debugging/subactor_bp_in_ctx.py @@ -1,3 +1,5 @@ +import platform + import tractor import trio @@ -34,9 +36,22 @@ async def just_bp( async def main(): + if platform.system() != 'Darwin': + tpt = 'uds' + else: + # XXX, precisely we can't use pytest's tmp-path generation + # for tests.. apparently because: + # + # > The OSError: AF_UNIX path too long in macOS Python occurs + # > because the path to the Unix domain socket exceeds the + # > operating system's maximum path length limit (around 104 + # + # WHICH IS just, wtf hillarious XD + tpt = 'tcp' + async with tractor.open_nursery( debug_mode=True, - enable_transports=['uds'], + enable_transports=[tpt], loglevel='devx', ) as n: p = await n.start_actor(