Hold a dependent service until a check passes. ready-check blocks the start of dependents until the named check reports healthy.
# Readiness gate: hold a dependent until a check passes.
processes:
- name: db
command: /usr/local/bin/db
args: ["300"]
on-failure: shutdown
- name: app
command: /usr/local/bin/app
args: ["300"]
after: [db]
ready-check: db-ready
ready-timeout: 10s
on-failure: shutdown
checks:
db-ready:
exec:
command: /bin/true
args: []
period: 300ms
threshold: 1
level: readyafter: [db]ordersappto start afterdb.ready-check: db-readygatesapp: it does not start until thedb-readycheck passes.ready-timeoutbounds the wait; if the check never passes, gopherd exits non-zero.level: readymarks the check as a readiness gate (vs. an ongoing liveness probe).
- gopherd starts
db, then runs thedb-readycheck. appstays unstarted untildb-readyreports healthy, then starts.- Both report
runningonce the gate opens. A failing check that never passes tripsready-timeoutand gopherd exits non-zero.
Run level. The test substitutes /usr/bin/sleep for both db and app. Because app carries a ready-check gate, a running app proves the gate opened after db-ready passed; the test asserts both db and app are running, then a clean SIGTERM exit 0.
The ready-timeout path (a check that never passes) is asserted in the root e2e suite (TestE2EReadyCheckTimeout).
go test ./documentation/ready-gate/ -v