From 00108010c910731a8f0b3875ca51d2564c0b1cae Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 13 Feb 2025 13:32:09 -0500 Subject: [PATCH] Mask `pytest` detection block in `piker.config` Seems to be some kinda super weird env bug since we moved to using `uv`? When it triggers it also seems to cause a pretty fundamental crash that not only breaks `tractor.devx._debug` stuff but also seems to get us in a perma-hang state where no SIGINT or other sys sig will be able to kill the root proc!?!? TODO, a `gitea` issue to track so we can fix the fundamental problem as well as transitive fault in `tractor`'s core which seems to be due to the error taking place during a sub-actor's module import phase which prevents the runtime from booting fully and then the proc getting stuck in a real gnarly SIG-state.. --- piker/config.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/piker/config.py b/piker/config.py index 981e5b5f..97eb4881 100644 --- a/piker/config.py +++ b/piker/config.py @@ -104,14 +104,15 @@ def get_app_dir( # `tractor`) with the testing dir and check for it whenever we # detect `pytest` is being used (which it isn't under normal # operation). - if "pytest" in sys.modules: - import tractor - actor = tractor.current_actor(err_on_no_runtime=False) - if actor: # runtime is up - rvs = tractor._state._runtime_vars - testdirpath = Path(rvs['piker_vars']['piker_test_dir']) - assert testdirpath.exists(), 'piker test harness might be borked!?' - app_name = str(testdirpath) + # if "pytest" in sys.modules: + # import tractor + # actor = tractor.current_actor(err_on_no_runtime=False) + # if actor: # runtime is up + # rvs = tractor._state._runtime_vars + # import pdbp; pdbp.set_trace() + # testdirpath = Path(rvs['piker_vars']['piker_test_dir']) + # assert testdirpath.exists(), 'piker test harness might be borked!?' + # app_name = str(testdirpath) if platform.system() == 'Windows': key = "APPDATA" if roaming else "LOCALAPPDATA"