Files
iAOP/tests/ha/__init__.py
T
bot_dev1 69d8178a83 feat(#89): 可用性/容灾演练套件(断点续传 + 故障隔离)
- 新增 tests/ha/ 容灾演练套件,4 个场景验证 PRD 第 9 章可用性/容灾 NFR:
  · 可用性基线:600 点位 30 轮健康采集,可用性 ≥ 99.8% / 丢失率 ≤ 0.02% / P99 ≤ 1.8s
  · 驱动故障隔离:30 轮中注入 5 轮设备掉线,引擎不崩溃,故障被隔离(_FlakyDriver 注入)
  · 上行抖动恢复:Kafka 中断 5 轮期间样本驻留 spool,恢复后断点续传零丢失
  · 进程重启容灾:销毁引擎模拟崩溃,重启后扫描 spool 全量重发(RPO=0)
- 演练结论:可用性 100%、丢失率 0%、P99=281ms(≤1.8s),SLA 全部达标
- 全部基于内核可注入接口(Driver/SpoolStore/HealthMetrics/BatchWriter)运行,零外部依赖
- 运行:python -m unittest discover -s tests/ha -v(_bootstrap.py 自动加载四个 core 模块)
2026-08-04 20:53:27 +08:00

15 lines
774 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""iAOP 可用性 / 容灾演练套件(Issue #89,对应 PRD 第 9 章 NFR)。
验证目标(PRD 第 9 章 SLA「可用性 ≥ 99.8%」+ 容灾/断点续传):
- #89 可用性 / 容灾演练:注入驱动级、上行级、进程级故障,验证
- 采集可用性 ≥ 99.8%(轮次级健康度);
- 进程重启后 spool 断点续传:未确认样本零丢失重发;
- 上行通道抖动不丢数据,仅增加本地缓存占用;
- 单驱动故障被隔离,不拖垮网关,SLA 仍达标。
全部基于各模块可注入接口运行,零外部依赖,CI 可直接执行。
运行:在仓库根目录执行 `python -m unittest discover -s tests/ha -v`
(_bootstrap.py 会自动加载四个 core 模块)。
"""