Skip to content

The agent that grows with you

test(agent): isolate compression timeout phases under load

Tekniuma5d3bb4211e9
diff --git a/tests/agent/test_compression_attempt_lifecycle.py b/tests/agent/test_compression_attempt_lifecycle.py
index 84879151fbb..15a24db7eb6 100644
--- a/tests/agent/test_compression_attempt_lifecycle.py
+++ b/tests/agent/test_compression_attempt_lifecycle.py
@@ -100,7 +100,8 @@ class TestWorkerTeardownOnCeiling:
worker=cooperative_worker,
messages=original,
system_prompt_fallback="fallback",
- idle_timeout_seconds=0.1,
+ # Keep idle expiry out of this total-ceiling test under runner load.
+ idle_timeout_seconds=2.0,
total_ceiling_seconds=0.2,
fence=fence,
stall_fallback=False,
diff --git a/tests/agent/test_compression_worker_isolation_76354.py b/tests/agent/test_compression_worker_isolation_76354.py
index fe976e5e5bc..e6cb046ba74 100644
--- a/tests/agent/test_compression_worker_isolation_76354.py
+++ b/tests/agent/test_compression_worker_isolation_76354.py
@@ -159,7 +159,8 @@ def test_host_timeout_releases_pool_slot_while_protected_provider_is_still_block
agent._cached_system_prompt = "sys"
monkeypatch.setattr(
"agent.conversation_compression.resolve_context_compression_timeouts",
- lambda cfg=None: (0.05, 0.1),
+ # Allow provider-thread startup under the parallel runner before timing out.
+ lambda cfg=None: (2.0, 4.0),
)
provider_started = threading.Event()
@@ -167,7 +168,7 @@ def test_host_timeout_releases_pool_slot_while_protected_provider_is_still_block
def _blocked_provider(_kwargs):
provider_started.set()
- assert release_provider.wait(timeout=10)
+ assert release_provider.wait(timeout=30)
return "late-provider-result"
def _compress_with_protected_provider(msgs, **_kwargs):
@@ -182,10 +183,10 @@ def test_host_timeout_releases_pool_slot_while_protected_provider_is_still_block
live, "sys", approx_tokens=120_000
)
assert returned is live
- assert provider_started.wait(timeout=1)
+ assert provider_started.wait(timeout=5)
assert not release_provider.is_set()
- deadline = time.time() + 1
+ deadline = time.time() + 5
while time.time() < deadline:
with cc._compress_admission_lock:
if cc._compress_admitted_count == 0: