From 6e88ab2a253adde6a767b6e7d4feb688c1e4a10e Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Thu, 23 Jul 2026 03:02:47 +0800 Subject: [PATCH] fix(targets): accept both DnsFailure and Unreachable in macOS DNS test (#5138) On macOS with DNS interception services, .invalid TLD domains resolve to an interception address (e.g. 198.18.16.173) instead of failing DNS resolution. The health probe then classifies the error as Unreachable rather than DnsFailure. Accept both outcomes since both are correct non-reachable error classifications. --- crates/targets/src/target/webhook.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/targets/src/target/webhook.rs b/crates/targets/src/target/webhook.rs index 101860424..8516d5550 100644 --- a/crates/targets/src/target/webhook.rs +++ b/crates/targets/src/target/webhook.rs @@ -936,7 +936,13 @@ mod tests { let health = probe_health_url(&client, &url).await; assert_eq!(health.state, TargetHealthState::Error); - assert_eq!(health.reason, TargetHealthReason::DnsFailure); + // On systems with DNS interception (common on macOS), `.invalid` may resolve + // to an interception address, producing `Unreachable` instead of `DnsFailure`. + assert!( + matches!(health.reason, TargetHealthReason::DnsFailure | TargetHealthReason::Unreachable), + "expected DnsFailure or Unreachable, got {:?}", + health.reason + ); } #[tokio::test(start_paused = true)]