Example plan
wait-for-api.yaml
New here? Get started. See Running the examplesfor this plan's fixture, runtime, database or browser requirements. The exec example needs no fixture; Postgres and Playwright need their optional dependencies.
Wait for a service to come up, then use it. waitFor repeats a request until its condition holds; it carries no assertions and never sits in a task that holds a resource.
apiVersion: vero.plan/v1
kind: Plan
metadata: { name: wait-for-api }
env:
baseUrl: http://127.0.0.1:18080
lifecycle: { strategy: isolated }
tasks:
- name: wait-for-api
steps:
- waitFor:
http: { method: GET, url: "{{ env.baseUrl }}/healthz" }
until: "status == 200"
timeout: 30s
interval: 250ms
- name: api-answers
needs: [wait-for-api]
steps:
- http: { method: GET, url: "{{ env.baseUrl }}/healthz" }
assert:
- status == 200
- headers["Content-Type"] startsWith "application/json"
- duration.ttfb < 1sThis page is examples/wait-for-api.yaml in the repository.