mirror of https://github.com/docker/docs.git
Update integration test. Reduce pending node validation sleep interval. Each pending node has its own validation interval according to failure count. So reducing sleep interval is not increasing validation frequency for unreachable nodes.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
parent
52a7616d99
commit
9a1584d508
|
@ -329,7 +329,7 @@ func (c *Cluster) monitorDiscovery(ch <-chan discovery.Entries, errCh <-chan err
|
|||
func (c *Cluster) monitorPendingEngines() {
|
||||
for {
|
||||
// Don't need to do it frequently
|
||||
time.Sleep(30 * time.Second)
|
||||
time.Sleep(10 * time.Second)
|
||||
// Get the list of pendingEngines
|
||||
c.RLock()
|
||||
pEngines := make([]*cluster.Engine, 0, len(c.pendingEngines))
|
||||
|
|
|
@ -31,25 +31,17 @@ function setup_discovery_file() {
|
|||
# Start swarm and check it can reach the node
|
||||
swarm_manage --engine-refresh-min-interval "1s" --engine-refresh-max-interval "1s" --engine-failure-retry 2 "$DISCOVERY"
|
||||
|
||||
run docker_swarm info
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${output}" == *"Status: Healthy"* ]]
|
||||
eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
||||
|
||||
# Stop the node and let it fail
|
||||
docker_host stop ${DOCKER_CONTAINERS[0]}
|
||||
sleep 4
|
||||
# Wait for swarm to detect node failure
|
||||
retry 5 1 eval "docker_swarm info | grep -q -i 'Status: Unhealthy'"
|
||||
|
||||
# Verify swarm detects node failure
|
||||
run docker_swarm info
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${output}" == *"Status: Unhealthy"* ]]
|
||||
|
||||
# Verify swarm detects recovery
|
||||
# Restart node
|
||||
docker_host start ${DOCKER_CONTAINERS[0]}
|
||||
sleep 4
|
||||
run docker_swarm info
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${output}" == *"Status: Healthy"* ]]
|
||||
# Wait for swarm to detect node recovery
|
||||
retry 5 1 eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
||||
}
|
||||
|
||||
@test "node pending and recovery" {
|
||||
|
@ -61,17 +53,11 @@ function setup_discovery_file() {
|
|||
|
||||
# Start swarm with the stopped node
|
||||
swarm_manage_no_wait "$DISCOVERY"
|
||||
run docker_swarm info
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${output}" == *"Status: Pending"* ]]
|
||||
retry 2 1 eval "docker_swarm info | grep -q -i 'Status: Pending'"
|
||||
|
||||
# Restart the node and wait for revalidation
|
||||
# Restart the node
|
||||
docker_host start ${DOCKER_CONTAINERS[0]}
|
||||
sleep 40
|
||||
|
||||
# Verify swarm detects recovery
|
||||
run docker_swarm info
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${output}" == *"Status: Healthy"* ]]
|
||||
# Wait for swarm to detect node recovery
|
||||
retry 15 3 eval "docker_swarm info | grep -q -i 'Status: Healthy'"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue