NeverENG opened a new issue, #26: URL: https://github.com/apache/dubbo-net/issues/26
## 背景与复现 `Tests/Shared/TestEndpointOptions.cs` 被 `Tests/QueryDemo`、`Tests/DubboClientIntegrationTests` 和单测复用;README 的本地运行示例也使用 `--host localhost`。这里的 Provider 地址应指向本机回环接口,而不是任意可用网卡。 当前 `ResolveProviderAddressesAsync()` 对非 IP 字面量直接调用 `Dns.GetHostAddressesAsync(ProviderHost)`。在一台 macOS / .NET 10 开发机上,`localhost` 的结果除了 `127.0.0.1`、`::1`,还包含 `192.168.*`、`fe80::*` 等非回环地址;`TestEndpointOptionsTest.LocalhostResolvesBeforeTheIpOnlyNativeConstructorIsUsed` 因此失败,示例也可能选错 Provider 地址。`/etc/hosts` 仍有正常的 localhost 回环记录,不应要求开发者修改系统配置来通过测试。该现象不代表所有 macOS 环境必然如此。 ## 建议范围 - 仅在测试/示例共用的地址工具中,把大小写不敏感的 `localhost` 明确映射到 IPv4 / IPv6 回环地址,并保留 IPv4 优先顺序。 - 其他主机名继续走 DNS;明确的 IP 字面量保持原样。不要更改 DubboNet 库的公开 API、注册发现或协议行为。 - 保留“结果必须是回环地址”的原断言,补默认(不传参)与显式 `localhost` / `LOCALHOST` 的回归覆盖,不通过跳过测试求绿。 ## 验收 - [ ] 上述本地测试路径稳定地选用回环地址;非 localhost 的解析规则不变。 - [ ] 完整单测、Release 构建与格式检查通过。 - [ ] PR 最新提交的线上检查(含端到端)实际运行并通过;本机未启用的端到端测试不能算通过。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
