mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 13:32:23 +00:00
test(observability): cover custom_openai 502 transient shape (#3659)
This commit is contained in:
@@ -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"] {
|
||||
|
||||
Reference in New Issue
Block a user