rehearsal: union task_attempts schema (main old DDL + gap-3 ledger cols), relax 2 hook no-table asserts to no-rows, gateway-env fake tolerates main routing reads, extend single-writer fixture list by name (test-only inserts)
This commit is contained in:
1 parent
f76a566aa8
commit
1eefe17474
4 files changed
+90
-3
No files matched your search
@@ -374,6 +374,18 @@ class GatewayTestCase(_Base):
|
||||
# 2564-2565
|
||||
class _BadEnv:
|
||||
def get(self, *a, **k):
|
||||
# 演练注:main 侧 Worker.__init__ 新增路由策略
|
||||
# 环境读取(CLOUD_ROUTING_POLICY_FILE/JSON,
|
||||
# 未包在 try 内);假 env 若全键抛错,构造即
|
||||
# 炸、测不到 key_available 本身。故仅对路由
|
||||
# 策略键回 None(= 未配策略),其余键仍抛错,
|
||||
# key_available 的失败回 False 断言意图不变。
|
||||
# 另:__init__ 两处裸 env.get 是否应包 try,
|
||||
# 属 main 侧跟进项,本演练不改生产 __init__。
|
||||
key = a[0] if a else k.get("key")
|
||||
if key in ("CLOUD_ROUTING_POLICY_FILE",
|
||||
"CLOUD_ROUTING_POLICY_JSON"):
|
||||
return None
|
||||
raise RuntimeError("env down")
|
||||
|
||||
w = Worker(self.db_path, "/fake/host.py", env=_BadEnv())
|
||||
|
||||
Reference in new issue
Block a user