fix: publish schedules after creation watermark
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user