mirror of
https://github.com/docker/compose.git
synced 2025-08-31 14:38:12 +02:00
This was racy with the sleep, so the Compose file has been tweaked to make it pass reliably. Now, there's 3 services: * `running` - sleeps forever * `exit` - exits _successfully_ immediately * depends on `running` started * `fail` - exits _with error_ immediately * depends on `exit` succeeding Now, the test can ensure that the containers are all run/ started in the expected order the assertions will be reliable. Before, it was possible for `fail` to run & exit before `exit`, for example. The `running` service also ensures there's always at least one other "running" container when we do an abort. Signed-off-by: Milas Bowman <milas.bowman@docker.com>
20 lines
335 B
YAML
20 lines
335 B
YAML
services:
|
|
running:
|
|
image: alpine
|
|
command: sleep infinity
|
|
init: true
|
|
|
|
exit:
|
|
image: alpine
|
|
command: /bin/true
|
|
depends_on:
|
|
running:
|
|
condition: service_started
|
|
|
|
fail:
|
|
image: alpine
|
|
command: sh -c "return 111"
|
|
depends_on:
|
|
exit:
|
|
condition: service_completed_successfully
|