Skip to content

Scheduled runs

A saved scenario, or a suite of them, can run on a schedule: nightly regression, every morning before the team arrives, every fifteen minutes against a system under change. A schedule is a cron expression in a time zone, so a nightly run is nightly where the team is, through daylight saving changes. Load runs and replays schedule the same way as functional scenarios.

Open a saved scenario and, under its steps, Add a schedule. Give it a name, a cron expression and a time zone:

Expression Runs
0 2 * * * every day at 02:00
0 2 * * 1-5 02:00 on weekdays
*/15 * * * * every fifteen minutes
30 6 1 * * 06:30 on the first of every month

The five fields are minute, hour, day of month, month and day of week, as cron reads them. The time zone is an IANA name such as Europe/Berlin, America/New_York or UTC; the form starts with your browser’s. The schedule shows when it next runs. A time that doesn’t exist on the night clocks go forward is skipped to the next that does.

Editors add, change, switch off and remove schedules; viewers see them. Deleting the scenario removes its schedules; its runs stay in the history.

A scheduled run is a run like any other: the same steps, the same checks before it starts (the test-data guard, the target, the pack’s codes, the install’s load limit), the same page and history. It is started by the Platform itself, with no user, so the run list and the run’s page say Schedule and the schedule’s name. In the API, its trigger is schedule.

A schedule that was due while the Platform was down runs once when it comes back, not once for every slot it missed. A schedule whose run couldn’t start (its scenario names a host that’s gone, say) keeps the reason beside it and tries again at its next time, so a fixed scenario runs without anyone touching the schedule.

GET /api/schedules every schedule, soonest first
GET /api/scenarios/{id}/schedules a scenario's schedules
POST /api/scenarios/{id}/schedules {name, expression, time_zone, enabled}
PUT /api/schedules/{id} the same fields
DELETE /api/schedules/{id}

A bad expression or an unknown time zone is refused with the reason. The run a schedule started is last_run_id, and the reason a run didn’t start is last_error.

  • A schedule runs one scenario or one suite; a suite’s page sets its schedules the same way (the suites walkthrough).
  • Several api instances may run the loop; each occurrence still starts once, since the database decides which instance takes it. The loop looks every thirty seconds, so a schedule starts within a minute of its time.