"""Test controls for durable approval-intent scheduling.""" from datetime import UTC, datetime, timedelta from sqlalchemy import update from sqlalchemy.ext.asyncio import AsyncSession from app.approval.models import ApprovalSubmissionIntent async def make_submission_intent_retries_due(db: AsyncSession) -> None: """Advance persisted retry schedules without sleeping in integration tests.""" await db.execute( update(ApprovalSubmissionIntent) .where(ApprovalSubmissionIntent.next_attempt_at.is_not(None)) .values(next_attempt_at=datetime.now(UTC) - timedelta(seconds=1)) ) await db.commit()