fix(acms): assert on last_remove_result in hot tier remove step
CI / lint (pull_request) Successful in 50s
CI / quality (pull_request) Successful in 1m4s
CI / build (pull_request) Successful in 27s
CI / security (pull_request) Successful in 1m19s
CI / push-validation (pull_request) Successful in 20s
CI / typecheck (pull_request) Successful in 1m29s
CI / helm (pull_request) Successful in 52s
CI / e2e_tests (pull_request) Successful in 3m14s
CI / integration_tests (pull_request) Successful in 3m29s
CI / unit_tests (pull_request) Successful in 6m15s
CI / docker (pull_request) Failing after 1s
CI / coverage (pull_request) Successful in 11m8s
CI / status-check (pull_request) Failing after 4s

Update the then-step for removing entries from the hot storage tier to
assert on context.last_remove_result (set by the when-step) instead of
calling remove() a second time. The double-removal caused the assertion
to always fail because the entry was already gone. Also update the
feature file scenarios to use the when-step before the then-step.

ISSUES CLOSED: #9972
This commit is contained in:
2026-05-04 23:22:18 +00:00
parent 55183cfcd7
commit cbb13b89a2
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -191,10 +191,12 @@ Feature: ACMS Hot Storage Tier (in-memory LRU cache)
Scenario: Remove returns the content of the removed entry
Given a HotStorageTier with no capacity limits
When I put entry "r2" with content "my-content"
And I remove "r2" from the hot tier
Then removing "r2" from the hot tier should return "my-content"
Scenario: Remove returns None for missing entry
Given a HotStorageTier with no capacity limits
When I remove "nonexistent" from the hot tier
Then removing "nonexistent" from the hot tier should return None
Scenario: Remove updates size_bytes correctly
@@ -126,13 +126,13 @@ def step_when_remove_entry(context: Any, entry_id: str) -> None:
@then('removing "{entry_id}" from the hot tier should return "{expected}"')
def step_then_remove_returns(context: Any, entry_id: str, expected: str) -> None:
result = context.hot_tier.remove(entry_id)
result = context.last_remove_result
assert result == expected, f"Expected {expected!r}, got {result!r}"
@then('removing "{entry_id}" from the hot tier should return None')
def step_then_remove_returns_none(context: Any, entry_id: str) -> None:
result = context.hot_tier.remove(entry_id)
result = context.last_remove_result
assert result is None, f"Expected None, got {result!r}"