From bf2887d4e39e62a1f72e48d2bb9069cdc843a543 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Mon, 25 Nov 2024 18:24:05 -0800 Subject: [PATCH] tests(*) increase robustness of httpbin-reliant tests We sometimes get a real 503 from httpbin.org as well. The tests still succeed in can of upstream errors. --- t/03-proxy_wasm/hfuncs/130-proxy_dispatch_http.t | 4 ++-- .../lua-bridge/002-proxy_wasm_lua_resolver_sanity.t | 8 ++++---- .../lua-bridge/003-proxy_wasm_lua_resolver_timeouts.t | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/t/03-proxy_wasm/hfuncs/130-proxy_dispatch_http.t b/t/03-proxy_wasm/hfuncs/130-proxy_dispatch_http.t index bb995bfdc..d05f0327f 100644 --- a/t/03-proxy_wasm/hfuncs/130-proxy_dispatch_http.t +++ b/t/03-proxy_wasm/hfuncs/130-proxy_dispatch_http.t @@ -428,11 +428,11 @@ qq{ echo fail; } } ---- error_code_like: (200|502|504) +--- error_code_like: (200|502|503|504) --- response_body_like (\s*"Hello": "world",\s* .*? -\s*"X-Thing": "foo,bar"\s*|.*?502 Bad Gateway.*|.*?504 Gateway Time-out.*) +\s*"X-Thing": "foo,bar"\s*|.*?502 Bad Gateway.*|.*?503 Service Temporarily Unavailable.*|.*?504 Gateway Time-out.*) --- no_error_log [error] [crit] diff --git a/t/04-openresty/lua-bridge/002-proxy_wasm_lua_resolver_sanity.t b/t/04-openresty/lua-bridge/002-proxy_wasm_lua_resolver_sanity.t index 3999e3e2f..a8295a803 100644 --- a/t/04-openresty/lua-bridge/002-proxy_wasm_lua_resolver_sanity.t +++ b/t/04-openresty/lua-bridge/002-proxy_wasm_lua_resolver_sanity.t @@ -33,8 +33,8 @@ Succeeds on: on_http_call_response=echo_response_body'; echo failed; } ---- error_code_like: (200|502|504) ---- response_body_like: ("Host": "httpbin\.org"|.*?502 Bad Gateway.*|.*?504 Gateway Time-out.*) +--- error_code_like: (200|502|503|504) +--- response_body_like: ("Host": "httpbin\.org"|.*?502 Bad Gateway.*|.*?503 Service Temporarily Unavailable.*|.*?504 Gateway Time-out.*) --- error_log eval [ qr/\[debug\] .*? wasm lua resolver thread/, @@ -307,8 +307,8 @@ Succeeds on: on_http_call_response=echo_response_body'; echo failed; } ---- error_code_like: (200|502|504) ---- response_body_like: ("Host": "httpbin\.org"|.*?502 Bad Gateway.*|.*?504 Gateway Time-out.*) +--- error_code_like: (200|502|503|504) +--- response_body_like: ("Host": "httpbin\.org"|.*?502 Bad Gateway.*|.*?503 Service Temporarily Unavailable.*|.*?504 Gateway Time-out.*) --- error_log eval [ qr/\[debug\] .*? wasm lua resolver creating new dns_client/, diff --git a/t/04-openresty/lua-bridge/003-proxy_wasm_lua_resolver_timeouts.t b/t/04-openresty/lua-bridge/003-proxy_wasm_lua_resolver_timeouts.t index 1e3de2822..1851d5e9d 100644 --- a/t/04-openresty/lua-bridge/003-proxy_wasm_lua_resolver_timeouts.t +++ b/t/04-openresty/lua-bridge/003-proxy_wasm_lua_resolver_timeouts.t @@ -40,8 +40,8 @@ Succeeds on: on_http_call_response=echo_response_body'; echo failed; } ---- error_code_like: (200|502|504) ---- response_body_like: ("Host": "httpbin\.org"|.*?502 Bad Gateway.*|.*?504 Gateway Time-out.*) +--- error_code_like: (200|502|503|504) +--- response_body_like: ("Host": "httpbin\.org"|.*?502 Bad Gateway.*|.*?503 Service Temporarily Unavailable.*|.*?504 Gateway Time-out.*) --- error_log eval [ qr/\[debug\] .*? wasm lua resolver thread/,