fix(acms): disambiguate hot tier size_bytes step from TierDistribution
CI / push-validation (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 37s
CI / helm (pull_request) Successful in 50s
CI / quality (pull_request) Successful in 53s
CI / typecheck (pull_request) Successful in 1m7s
CI / build (pull_request) Successful in 1m7s
CI / security (pull_request) Successful in 1m19s
CI / unit_tests (pull_request) Successful in 4m43s
CI / docker (pull_request) Successful in 1m47s
CI / coverage (pull_request) Successful in 11m47s
CI / integration_tests (pull_request) Successful in 17m19s
CI / status-check (pull_request) Successful in 5s

The new step `the hot tier size_bytes should be {n:d}` in
features/steps/acms_hot_storage_tier_steps.py shared the matched
pattern of the existing
`the hot tier size_bytes should be {expected:d}` step in
features/steps/acms_context_analysis_engine_steps.py — Behave's
step registry strips parameter names when computing the pattern,
so both compile to the same regex. Every scenario hitting the
step raised AmbiguousStep at run-time, which Behave reports as
"errored" (not "failed"); that produced the 6 errored scenarios
on `features/acms_hot_storage_tier.feature` (lines 9, 96, 101,
149, 202, 210) seen in CI unit_tests.

Rename the new step and its `at most` companion to
`the hot storage tier size_bytes should be ...` (mirroring the
HotStorageTier class name) so the patterns no longer collide
with the analysis-engine TierDistribution step. Update the 8
feature-file references in `acms_hot_storage_tier.feature` to
match. The other-metric steps (entry_count, hit_count, miss_count,
max_entries, max_bytes) keep their `the hot tier` prefix because
they have no analogous collision — the analysis-engine file uses
`count` (not `entry_count`), so they are already unambiguous.

ISSUES CLOSED: #9972
This commit is contained in:
2026-06-13 00:39:11 -04:00
committed by drew
parent e39087b59c
commit a54cf845c2
2 changed files with 10 additions and 10 deletions
+8 -8
View File
@@ -9,7 +9,7 @@ Feature: ACMS Hot Storage Tier (in-memory LRU cache)
Scenario: Create HotStorageTier with no limits
Given a HotStorageTier with no capacity limits
Then the hot tier entry_count should be 0
And the hot tier size_bytes should be 0
And the hot storage tier size_bytes should be 0
And the hot tier hit_count should be 0
And the hot tier miss_count should be 0
@@ -96,13 +96,13 @@ Feature: ACMS Hot Storage Tier (in-memory LRU cache)
Scenario: size_bytes reflects UTF-8 encoded content size
Given a HotStorageTier with no capacity limits
When I put entry "k1" with content "hello"
Then the hot tier size_bytes should be 5
Then the hot storage tier size_bytes should be 5
Scenario: size_bytes updates when entry is replaced
Given a HotStorageTier with no capacity limits
When I put entry "k1" with content "hi"
And I put entry "k1" with content "hello world"
Then the hot tier size_bytes should be 11
Then the hot storage tier size_bytes should be 11
# ---- LRU eviction: max_entries ----
@@ -143,14 +143,14 @@ Feature: ACMS Hot Storage Tier (in-memory LRU cache)
When I put entry "k1" with content "12345"
And I put entry "k2" with content "67890"
And I put entry "k3" with content "abcde"
Then the hot tier size_bytes should be at most 10
Then the hot storage tier size_bytes should be at most 10
And getting "k1" from the hot tier should return None
Scenario: Single entry larger than max_bytes is evicted immediately
Given a HotStorageTier with max_bytes 3
When I put entry "big" with content "hello"
Then the hot tier entry_count should be 0
And the hot tier size_bytes should be 0
And the hot storage tier size_bytes should be 0
# ---- Eviction callback (warm-tier demotion) ----
@@ -203,7 +203,7 @@ Feature: ACMS Hot Storage Tier (in-memory LRU cache)
Given a HotStorageTier with no capacity limits
When I put entry "s1" with content "hello"
And I remove "s1" from the hot tier
Then the hot tier size_bytes should be 0
Then the hot storage tier size_bytes should be 0
# ---- Clear ----
@@ -213,7 +213,7 @@ Feature: ACMS Hot Storage Tier (in-memory LRU cache)
And I put entry "c2" with content "bbb"
And I clear the hot tier
Then the hot tier entry_count should be 0
And the hot tier size_bytes should be 0
And the hot storage tier size_bytes should be 0
Scenario: Clear does not reset hit/miss counters
Given a HotStorageTier with no capacity limits
@@ -239,4 +239,4 @@ Feature: ACMS Hot Storage Tier (in-memory LRU cache)
Given a HotStorageTier with max_bytes 100
When 8 threads concurrently put large entries into the hot tier
Then no exception should have been raised during concurrent evictions
And the hot tier size_bytes should be at most 100
And the hot storage tier size_bytes should be at most 100
@@ -158,14 +158,14 @@ def step_then_entry_count(context: Any, n: int) -> None:
)
@then("the hot tier size_bytes should be {n:d}")
@then("the hot storage tier size_bytes should be {n:d}")
def step_then_size_bytes(context: Any, n: int) -> None:
assert context.hot_tier.size_bytes == n, (
f"Expected size_bytes={n}, got {context.hot_tier.size_bytes}"
)
@then("the hot tier size_bytes should be at most {n:d}")
@then("the hot storage tier size_bytes should be at most {n:d}")
def step_then_size_bytes_at_most(context: Any, n: int) -> None:
assert context.hot_tier.size_bytes <= n, (
f"Expected size_bytes <= {n}, got {context.hot_tier.size_bytes}"