test(observability): cover custom_openai 502 transient shape (#3659)

This commit is contained in:
Zhang
2026-06-16 17:06:03 +05:30
committed by GitHub
parent 34fb879f71
commit 7dbbb9d71c
+18
View File
@@ -3343,6 +3343,7 @@ mod tests {
"OpenHuman API error (408): request timeout",
"OpenAI API error (429 Too Many Requests): rate limit",
"Anthropic API error (502 Bad Gateway): upstream unhealthy",
"custom_openai API error (502 Bad Gateway): upstream gateway blip",
"OpenHuman API error (503): service unavailable",
"Provider API error (504): upstream timed out",
] {
@@ -4697,6 +4698,23 @@ mod tests {
}
}
#[test]
fn custom_openai_502_event_shape_is_transient_provider_http() {
let event = event_with_tags_and_message(
&[
("domain", "llm_provider"),
("provider", "custom_openai"),
("failure", "non_2xx"),
("status", "502"),
],
"custom_openai API error (502 Bad Gateway): upstream gateway blip",
);
assert!(
is_transient_provider_http_failure(&event),
"custom_openai 502 attempts should be treated as transient provider HTTP noise"
);
}
#[test]
fn transient_filter_keeps_permanent_failures() {
for status in ["400", "401", "403", "404", "500"] {