From 1ec20fd25d648105afca8444ac0997423b438b01 Mon Sep 17 00:00:00 2001 From: Alex Nails Date: Mon, 24 Aug 2026 16:55:35 -0700 Subject: [PATCH] [CI] Stop the resolution ratchets re-parsing the whole package (#36235) Co-authored-by: Claude Opus 5 (1M context) --- .../server_args/test_resolution_is_reproducible.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/registered/unit/server_args/test_resolution_is_reproducible.py b/test/registered/unit/server_args/test_resolution_is_reproducible.py index 39e279752..f5decb963 100644 --- a/test/registered/unit/server_args/test_resolution_is_reproducible.py +++ b/test/registered/unit/server_args/test_resolution_is_reproducible.py @@ -689,13 +689,14 @@ class TestForksResolveFirst(CustomTestCase): continue try: source = path.read_text(encoding="utf-8-sig") + if "Process" not in source: + continue tree = ast.parse(source) except (SyntaxError, UnicodeDecodeError): continue for node in ast.walk(tree): if not isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)): continue - body = ast.get_source_segment(source, node) or "" forks = [ call for call in ast.walk(node) @@ -714,6 +715,7 @@ class TestForksResolveFirst(CustomTestCase): ] if not forks: continue + body = ast.get_source_segment(source, node) or "" examined += 1 # `spawn` starts a fresh interpreter, so the child may probe. if 'get_context("spawn")' in body or "'spawn'" in body: @@ -939,7 +941,10 @@ class TestTheResolutionSeamHasOneCaller(CustomTestCase): callers = [] for path in sorted(package_root.rglob("*.py")): try: - tree = ast.parse(path.read_text()) + source = path.read_text() + if "_run_resolution_pipeline" not in source: + continue + tree = ast.parse(source) except SyntaxError: continue # The full (class, function, ...) scope chain, so the assertion can @@ -988,7 +993,10 @@ class TestTheResolutionSeamHasOneCaller(CustomTestCase): callers = [] for path in sorted(package_root.rglob("*.py")): try: - tree = ast.parse(path.read_text()) + source = path.read_text() + if "resolve_once" not in source: + continue + tree = ast.parse(source) except SyntaxError: continue for node in ast.walk(tree):