Skip to content

Commit b7e4e01

Browse files
committed
Make preparation fault injection reach its intended boundary
Signed-off-by: huangruiteng <huangrt01@163.com>
1 parent 3ee6bb6 commit b7e4e01

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎tests/control_plane/test_quota_execution_preparation.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,9 @@ def observe_guard(command, **kwargs):
575575
prepared = "--prepared-capture-reference" in command
576576
if prepared:
577577
assert ("--complete-turn" in command) is (replace_stage in {"version", "downgrade"})
578-
result = run(command, **kwargs)
578+
# Reach the injected capture replacement even under suite contention.
579+
# This test exercises identity refusal, not the hook's wall-clock budget.
580+
result = run(command, **{**kwargs, "timeout": 30})
579581
if prepared:
580582
verified["writer"] = json.loads(result.stdout)
581583
if replace_stage == "guard":
@@ -730,9 +732,9 @@ def interrupt_first_guard(command, **kwargs):
730732
guards.append(command[command.index("--turn-instance-id") + 1])
731733
if not after_ready and len(guards) == 1:
732734
raise subprocess.TimeoutExpired(command, kwargs["timeout"])
733-
# Reach the deliberate post-ready fault rather than accidentally
734-
# injecting the separate pre-commit timeout under test contention.
735-
result = run(command, **{**kwargs, "timeout": 30} if after_ready else kwargs)
735+
# Complete prerequisites before the explicit guard/ready fault above;
736+
# accidental claim timeouts would test a different recovery boundary.
737+
result = run(command, **{**kwargs, "timeout": 30})
736738
if "claim" in command:
737739
claims.append(json.loads(result.stdout))
738740
return result

0 commit comments

Comments
 (0)