mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-28 09:08:58 +00:00
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.
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user