This commit is contained in:
1 parent
4db3f45164
commit
d25c04cdd2
175 files changed
+56243
-15
No files matched your search
@@ -0,0 +1,29 @@
|
||||
"""Terminate acceptance at a durable publication boundary for recovery tests."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from gewu.domain.contracts import ProposalRevision
|
||||
from tests.application.test_acceptance import ACTOR, _service
|
||||
|
||||
|
||||
def main() -> None:
|
||||
data_root = Path(sys.argv[1])
|
||||
proposal_path = Path(sys.argv[2])
|
||||
crash_stage = sys.argv[3]
|
||||
proposal = ProposalRevision.model_validate_json(proposal_path.read_bytes(), strict=True)
|
||||
|
||||
def terminate(stage: str) -> None:
|
||||
if stage == crash_stage:
|
||||
os._exit(73)
|
||||
|
||||
service, *_ = _service(data_root, hook=terminate)
|
||||
service.submit(proposal, actor=ACTOR)
|
||||
raise RuntimeError(f"Acceptance completed without reaching crash stage {crash_stage}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user