From b2c394bcad6c937e90ccca46712a3a829fc9beae Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 7 Sep 2026 07:20:45 -0700 Subject: [PATCH] test: derive process_manage verbs from the handler table; widen aux-cancellation start-up bound The schema-diet test froze the verb list (a change-detector); it now asserts the enum matches _SESSION_ACTIONS plus the by-name verbs. The cancellation harness gave a worker thread 1 s to reach its transport, which a loaded CI runner missed twice this week; the cancellation-latency assertion is unchanged, only the start-up wait is wider. --- tests/agent/test_auxiliary_explicit_cancellation.py | 5 +++-- tests/tools/test_process_schema_diet.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/agent/test_auxiliary_explicit_cancellation.py b/tests/agent/test_auxiliary_explicit_cancellation.py index 4fabf8f98f..8330ab5806 100644 --- a/tests/agent/test_auxiliary_explicit_cancellation.py +++ b/tests/agent/test_auxiliary_explicit_cancellation.py @@ -143,10 +143,11 @@ def _cancel_silent_request( worker = threading.Thread(target=_worker, daemon=True) worker.start() - assert started.wait(timeout=1), "request never entered its silent transport" + # Thread start-up on a loaded CI runner can exceed 1 s; the bound is only "eventually entered the transport". + assert started.wait(timeout=5), "request never entered its silent transport" cancelled_at = time.monotonic() cancel_event.set() - worker.join(timeout=1) + worker.join(timeout=5) elapsed = time.monotonic() - cancelled_at assert not worker.is_alive(), "explicit cancellation did not wake the silent request" return result["exc"], elapsed diff --git a/tests/tools/test_process_schema_diet.py b/tests/tools/test_process_schema_diet.py index 7148cca290..0086d87c2f 100644 --- a/tests/tools/test_process_schema_diet.py +++ b/tests/tools/test_process_schema_diet.py @@ -28,11 +28,11 @@ class TestProcessSchemaDiet(unittest.TestCase): self.assertIn("last 200", props["offset"]["description"]) def test_enum_is_the_verb_source(self): + from tools.process_registry import _SESSION_ACTIONS props = PROCESS_SCHEMA["parameters"]["properties"] - self.assertEqual( - props["action"]["enum"], - ["list", "poll", "log", "wait", "kill", "write", "submit", "close"], - ) + # The enum is the single list of verbs: every session-scoped handler is offered, plus the two + # non-session verbs dispatched by name in _handle_process. + self.assertEqual(set(props["action"]["enum"]), set(_SESSION_ACTIONS) | {"list", "handoff"}) # No redundant description on the enum param. self.assertNotIn("description", props["action"])