mirror of
https://github.com/status-im/consul.git
synced 2025-02-23 10:58:25 +00:00
fix flaky integration test (#14843)
This commit is contained in:
parent
d9fe3578ac
commit
622804ad5b
@ -26,28 +26,11 @@ load helpers
|
|||||||
assert_upstream_has_endpoints_in_status 127.0.0.1:20000 s1 HEALTHY 1
|
assert_upstream_has_endpoints_in_status 127.0.0.1:20000 s1 HEALTHY 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "s1 proxy should have been configured with max_connections in services" {
|
|
||||||
CLUSTER_THRESHOLD=$(get_envoy_cluster_config 127.0.0.1:20000 s1.default.primary | jq '.circuit_breakers.thresholds[0]')
|
|
||||||
echo $CLUSTER_THRESHOLD
|
|
||||||
|
|
||||||
MAX_CONNS=$(echo $CLUSTER_THRESHOLD | jq --raw-output '.max_connections')
|
|
||||||
MAX_PENDING_REQS=$(echo $CLUSTER_THRESHOLD | jq --raw-output '.max_pending_requests')
|
|
||||||
MAX_REQS=$(echo $CLUSTER_THRESHOLD | jq --raw-output '.max_requests')
|
|
||||||
|
|
||||||
echo "MAX_CONNS = $MAX_CONNS"
|
|
||||||
echo "MAX_PENDING_REQS = $MAX_PENDING_REQS"
|
|
||||||
echo "MAX_REQS = $MAX_REQS"
|
|
||||||
|
|
||||||
[ "$MAX_CONNS" = "100" ]
|
|
||||||
[ "$MAX_PENDING_REQS" = "200" ]
|
|
||||||
[ "$MAX_REQS" = "300" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "ingress-gateway should have healthy endpoints for s2" {
|
@test "ingress-gateway should have healthy endpoints for s2" {
|
||||||
assert_upstream_has_endpoints_in_status 127.0.0.1:20000 s2 HEALTHY 1
|
assert_upstream_has_endpoints_in_status 127.0.0.1:20000 s2 HEALTHY 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "s2 proxy should have been configured with max_connections using defaults" {
|
@test "s2 proxy should have been configured with connection threshold from defaults" {
|
||||||
CLUSTER_THRESHOLD=$(get_envoy_cluster_config 127.0.0.1:20000 s2.default.primary | jq '.circuit_breakers.thresholds[0]')
|
CLUSTER_THRESHOLD=$(get_envoy_cluster_config 127.0.0.1:20000 s2.default.primary | jq '.circuit_breakers.thresholds[0]')
|
||||||
echo $CLUSTER_THRESHOLD
|
echo $CLUSTER_THRESHOLD
|
||||||
|
|
||||||
|
@ -2,7 +2,11 @@ config_entries {
|
|||||||
bootstrap {
|
bootstrap {
|
||||||
kind = "ingress-gateway"
|
kind = "ingress-gateway"
|
||||||
name = "ingress-gateway"
|
name = "ingress-gateway"
|
||||||
|
Defaults {
|
||||||
|
MaxConnections = 10
|
||||||
|
MaxPendingRequests = 20
|
||||||
|
MaxConcurrentRequests = 30
|
||||||
|
}
|
||||||
listeners = [
|
listeners = [
|
||||||
{
|
{
|
||||||
port = 9999
|
port = 9999
|
||||||
@ -10,6 +14,8 @@ config_entries {
|
|||||||
services = [
|
services = [
|
||||||
{
|
{
|
||||||
name = "s1"
|
name = "s1"
|
||||||
|
MaxConnections = 100
|
||||||
|
MaxPendingRequests = 200
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,23 @@ load helpers
|
|||||||
assert_upstream_has_endpoints_in_status 127.0.0.1:20000 s1 HEALTHY 1
|
assert_upstream_has_endpoints_in_status 127.0.0.1:20000 s1 HEALTHY 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "s1 proxy should have been configured with connection threshold from defaults and service" {
|
||||||
|
CLUSTER_THRESHOLD=$(get_envoy_cluster_config 127.0.0.1:20000 s1.default.primary | jq '.circuit_breakers.thresholds[0]')
|
||||||
|
echo $CLUSTER_THRESHOLD
|
||||||
|
|
||||||
|
MAX_CONNS=$(echo $CLUSTER_THRESHOLD | jq --raw-output '.max_connections')
|
||||||
|
MAX_PENDING_REQS=$(echo $CLUSTER_THRESHOLD | jq --raw-output '.max_pending_requests')
|
||||||
|
MAX_REQS=$(echo $CLUSTER_THRESHOLD | jq --raw-output '.max_requests')
|
||||||
|
|
||||||
|
echo "MAX_CONNS = $MAX_CONNS"
|
||||||
|
echo "MAX_PENDING_REQS = $MAX_PENDING_REQS"
|
||||||
|
echo "MAX_REQS = $MAX_REQS"
|
||||||
|
|
||||||
|
[ "$MAX_CONNS" = "100" ]
|
||||||
|
[ "$MAX_PENDING_REQS" = "200" ]
|
||||||
|
[ "$MAX_REQS" = "30" ]
|
||||||
|
}
|
||||||
|
|
||||||
@test "ingress should be able to connect to s1 via configured port" {
|
@test "ingress should be able to connect to s1 via configured port" {
|
||||||
run retry_default curl -s -f -d hello localhost:9999
|
run retry_default curl -s -f -d hello localhost:9999
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user