Skip to content

Instantly share code, notes, and snippets.

@amy
Last active August 14, 2017 16:52
Show Gist options
  • Save amy/f34edd7e599363ec8789b3971e24c4e6 to your computer and use it in GitHub Desktop.
Save amy/f34edd7e599363ec8789b3971e24c4e6 to your computer and use it in GitHub Desktop.
Failure Stack:
// docker-compose.yml
version: '2'
services:
amy-test:
image: nginx
scale: 1
health_check:
port: 80
request_line: GET /fail HTTP/1.0
interval: 2000
initializing_timeout: 60000
reinitializing_timeout: 60000
unhealthy_threshold: 5
strategy: none
healthy_threshold: 2
response_timeout: 2000
Success Stack:
// docker-compose.yml
version: '2'
services:
amy-test:
image: nginx
restart: always
scale: 1
Combined Stack:
version: '2'
services:
amy-failure:
image: nginx
scale: 1
health_check:
port: 80
request_line: GET /fail HTTP/1.0
interval: 2000
initializing_timeout: 60000
reinitializing_timeout: 60000
unhealthy_threshold: 5
strategy: none
healthy_threshold: 2
response_timeout: 2000
amy-success:
image: nginx
scale: 1
health_check:
port: 80
request_line: GET /fail HTTP/1.0
interval: 2000
initializing_timeout: 60000
reinitializing_timeout: 60000
unhealthy_threshold: 5
strategy: none
healthy_threshold: 2
response_timeout: 2000
In testing, the above docker-compose files correlate with the stack name in the command.
NOTE: Make sure to delete stacks in between scenarios unless otherwise indicated
Scenario 0: Failure
rancher --wait --wait-state "initializing" up -s "failure-stack" --pull -d
Behavior: Cli should return and the state of the stack should be initializing.
Scenario 1: Failure
rancher --wait --wait-state "healthy" up -s "failure-stack" --pull -d
Behavior: Cli should not return.
Scenario 2: Failure Timeout
rancher --wait --wait-state "healthy" --wait-timeout 10 -s "failure-stack" --pull -d
Behavior: Cli should return after timeout period.
Scenario 3: Failure wait
rancher --wait "failure-stack" --pull -d
Behavior: Cli should return.
Scenario 4: Success
rancher --wait --wait-state "healthy" up -s "success-stack" --pull -d
Behavior: Stack should return. And state of stack in the UI should be healthy.
Scenario 5: Success
rancher --wait up -s "success-stack" --pull -d
Behavior: Stack should return. And state of stack in the UI should be healthy.
Scenario 6: Failure & Success
rancher up -s "failure-stack" --pull -d
rancher --wait --wait-state "healthy" up -s "success-stack" --pull -d
Behavior: Stack should return. And state of stack in the UI should be healthy.
Scenario 7: Success & Failure
rancher up -s "success-stack" --pull -d
rancher --wait --wait-state "healthy" up -s "failure-stack" --pull -d
Behavior: Stack should not return.
Scenario 8: Combined
rancher --wait --wait-state "healthy" up -s "combined-stack" --pull -d
Behavior: Stack should not return.
Scenario 9: Combined
rancher --wait --wait-state "healthy" up --wait-timeout 10 -s "combined-stack" --pull -d
Behavior: Stack should return after timeout.
Scenario 10: Combined
rancher --wait "combined-stack" --pull -d
Behavior: Stack should return.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment