From 96ea93c033ab449f1fc0177c0a9ab5eb181a8781 Mon Sep 17 00:00:00 2001 From: Frank Budinsky Date: Thu, 24 Nov 2022 13:54:06 -0500 Subject: [PATCH] Fix mirroring test flake again (#12290) --- .../traffic-management/mirroring/test.sh | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/content/en/docs/tasks/traffic-management/mirroring/test.sh b/content/en/docs/tasks/traffic-management/mirroring/test.sh index b984e6e8b8..3644999edd 100644 --- a/content/en/docs/tasks/traffic-management/mirroring/test.sh +++ b/content/en/docs/tasks/traffic-management/mirroring/test.sh @@ -27,19 +27,13 @@ GATEWAY_API="${GATEWAY_API:-false}" kubectl label namespace default istio-injection- --overwrite -snip_before_you_begin_1 - -snip_before_you_begin_2 - +# create the httpbin service snip_before_you_begin_3 -snip_before_you_begin_4 - -# wait for deployments -_wait_for_deployment default httpbin-v1 -_wait_for_deployment default httpbin-v2 -_wait_for_deployment default sleep - +# Configure the httpbin route before deploying the services to allow lots +# of time for the config to be ready before the first request. If too soon, +# it might send a request to v2, which will cuase the test to fail +# _verify_not_contains snip_creating_a_default_routing_policy_5. if [ "$GATEWAY_API" == "true" ]; then snip_creating_a_default_routing_policy_2 sleep 20s # TODO proper wait for config update @@ -51,6 +45,16 @@ else _wait_for_istio destinationrule default httpbin fi +# deploy the services +snip_before_you_begin_1 +_wait_for_deployment default httpbin-v1 + +snip_before_you_begin_2 +_wait_for_deployment default httpbin-v2 + +snip_before_you_begin_4 +_wait_for_deployment default sleep + send_request_and_get_v1_log() { _verify_contains snip_creating_a_default_routing_policy_3 "headers" out=$(snip_creating_a_default_routing_policy_4)