scheduled_task and scheduler_replay + tests