mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
test(approval): loosen wall-clock perf bounds 0.15s -> 2.0s
These guard against catastrophic regex backtracking (seconds-to-minutes class), but 0.15s is within scheduler-stall noise on loaded shared CI runners — test_max_accepted_separator_free_input_is_fast failed a CI shard this week on runner load alone. 2.0s still catches the regression class with zero flake surface.
This commit is contained in:
parent
cc96368175
commit
0cda648dfb
1 changed files with 8 additions and 2 deletions
|
|
@ -557,7 +557,11 @@ def test_long_separator_free_token_hits_early_cap_before_regexes(size):
|
|||
"command parser limit exceeded",
|
||||
"command parser limit exceeded",
|
||||
)
|
||||
assert elapsed < 0.15, f"{size} byte token took {elapsed:.3f}s"
|
||||
# Guards against catastrophic regex backtracking (seconds-to-minutes).
|
||||
# The bound is deliberately loose: on a loaded shared CI runner even a
|
||||
# trivially-fast call can see 100s of ms of scheduler stall, so a tight
|
||||
# bound flakes without catching anything extra.
|
||||
assert elapsed < 2.0, f"{size} byte token took {elapsed:.3f}s"
|
||||
|
||||
|
||||
def test_max_accepted_separator_free_input_is_fast():
|
||||
|
|
@ -569,4 +573,6 @@ def test_max_accepted_separator_free_input_is_fast():
|
|||
elapsed = time.perf_counter() - started
|
||||
|
||||
assert result == (False, None, None)
|
||||
assert elapsed < 0.15, f"max accepted token took {elapsed:.3f}s"
|
||||
# Loose bound: catches the O(n^2)/backtracking regression class without
|
||||
# flaking on CI scheduler stalls (see comment above).
|
||||
assert elapsed < 2.0, f"max accepted token took {elapsed:.3f}s"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue