From a54cf845c29ea2ecce6148a02222cb96baaf352f Mon Sep 17 00:00:00 2001 From: CleverThis Date: Sat, 13 Jun 2026 00:39:11 -0400 Subject: [PATCH] fix(acms): disambiguate hot tier size_bytes step from TierDistribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- features/acms_hot_storage_tier.feature | 16 ++++++++-------- features/steps/acms_hot_storage_tier_steps.py | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/features/acms_hot_storage_tier.feature b/features/acms_hot_storage_tier.feature index b1849d075..731c5903e 100644 --- a/features/acms_hot_storage_tier.feature +++ b/features/acms_hot_storage_tier.feature @@ -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 diff --git a/features/steps/acms_hot_storage_tier_steps.py b/features/steps/acms_hot_storage_tier_steps.py index bf05bfc99..c22af9af7 100644 --- a/features/steps/acms_hot_storage_tier_steps.py +++ b/features/steps/acms_hot_storage_tier_steps.py @@ -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}"