From 171b5ee140f4ba98c40e71baffc21e5feeca28e0 Mon Sep 17 00:00:00 2001 From: Zhang <56248212+YonganZhang@users.noreply.github.com> Date: Tue, 16 Jun 2026 19:36:59 +0800 Subject: [PATCH] test(observability): cover custom_openai Ollama timeout chain (#3660) --- src/core/observability.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/core/observability.rs b/src/core/observability.rs index 364c9fdac..7f07c6d1d 100644 --- a/src/core/observability.rs +++ b/src/core/observability.rs @@ -3152,6 +3152,20 @@ mod tests { } } + #[test] + fn custom_openai_ollama_timeout_fallback_chain_is_network_unreachable() { + let chain = + "custom_openai chat completions transport error: error sending request for url \ + (http://localhost:11434/v1/chat/completions): operation timed out \ + (responses fallback failed: custom_openai API error (404 Not Found): \ + {\"error\":\"not found\"})"; + assert_eq!( + expected_error_kind(chain), + Some(ExpectedErrorKind::NetworkUnreachable), + "local Ollama timeout plus responses fallback failure must not page Sentry" + ); + } + #[test] fn does_not_classify_unrelated_provider_errors_as_network() { // Status-bearing provider failures (404, 500, …) are surfaced via