Skip to content

The agent that grows with you

test(config): drop the hook-timeout call-count proxy test

kshitijk4poor50a498bfdcc9
diff --git a/hermes_cli/plugins.py b/hermes_cli/plugins.py
index e998382ee15..8e7eb7911dd 100644
--- a/hermes_cli/plugins.py
+++ b/hermes_cli/plugins.py
@@ -1137,11 +1137,6 @@ del _name, _method
_HOOK_TIMEOUT_CACHE: Dict[str, Tuple[Any, float]] = {}
-def _reset_hook_callback_timeout_cache() -> None:
- """Drop the memoized hook-callback timeouts (test-only; production relies on the sig check)."""
- _HOOK_TIMEOUT_CACHE.clear()
-
-
def _resolve_hook_callback_timeout() -> float:
"""Effective hook-callback timeout from ``plugins.hook_callback_timeout`` (default 30s; ``<= 0``
disables the threaded path; clamped to ``_MAX_HOOK_CALLBACK_TIMEOUT_SECS``).
diff --git a/tests/hermes_cli/test_config_lock_free_cache_hit.py b/tests/hermes_cli/test_config_lock_free_cache_hit.py
index 94989824a54..0ab1bfa0587 100644
--- a/tests/hermes_cli/test_config_lock_free_cache_hit.py
+++ b/tests/hermes_cli/test_config_lock_free_cache_hit.py
@@ -2,7 +2,7 @@
``_load_config_impl`` served cache hits from inside ``_CONFIG_LOCK``, which
``save_config()`` holds across an atomic YAML write. A cache hit itself costs
-~0.024us-scale work, but measured on a clean tree the same cached read took
+~0.024ms-scale work, but measured on a clean tree the same cached read took
**10010ms** while another thread held the lock.
On a gateway that lands on the event loop: the per-message hook path
@@ -103,34 +103,6 @@ def test_cached_raw_read_completes_while_another_thread_holds_the_config_lock(co
)
-def test_hook_timeout_does_not_read_config_on_every_invocation(config_home):
- from hermes_cli import config as cfgmod
- from hermes_cli import plugins as pluginsmod
-
- pluginsmod._reset_hook_callback_timeout_cache()
- assert pluginsmod._resolve_hook_callback_timeout() == 30.0
-
- calls = {"n": 0}
- real = cfgmod.load_config_readonly
-
- def counting():
- calls["n"] += 1
- return real()
-
- cfgmod.load_config_readonly = counting # type: ignore[assignment]
- try:
- for _ in range(100):
- pluginsmod._resolve_hook_callback_timeout()
- finally:
- cfgmod.load_config_readonly = real # type: ignore[assignment]
-
- assert calls["n"] == 0, (
- f"hook-timeout resolution read the config {calls['n']}x across 100 hook "
- "invocations; a gateway fires hooks per inbound message, so this is a "
- "per-message config read on the event loop"
- )
-
-
def test_hook_timeout_memo_never_pairs_a_new_sig_with_an_old_value(config_home):
"""The memo is published as ONE ``(sig, value)`` tuple: with a writer thread flipping the config
between two timeouts, every lock-free read must see sig and value from the SAME publish."""