fix: publish schedules after creation watermark

This commit is contained in:
lda
2026-09-09 18:39:00 +07:00 Verified
parent 86a52adda5
commit 39993c9d5e
2 changed files with 33 additions and 4 deletions
+20
View File
@@ -528,6 +528,26 @@ async def test_create_initializes_consumed_no_backfill(tmp_path: Path) -> None:
assert consumed is not None and consumed >= created_at
async def test_create_watermark_failure_does_not_publish_schedule(
tmp_path: Path,
) -> None:
"""A failed creation watermark cannot expose a backfillable schedule."""
api, sched_store, _ = _fault_harness(tmp_path / "torn_create")
sched_store.armed = True
with pytest.raises(OSError, match="injected consumed failure"):
await api.create_schedule(
schedule_id="s",
deployment_id="dep.personal",
trigger=_cron(),
misfire="latest",
)
with pytest.raises(KeyError):
sched_store.get_schedule("s")
assert sched_store.get_consumed("s") is None
async def test_update_watermark_failure_leaves_revision(tmp_path: Path) -> None:
api, sched_store, _ = _fault_harness(tmp_path / "torn_update")