fix(transport): make the invalid-hostname test independent of the search domain

test_resolve_socket_addr_invalid asserts that nonexistent.invalid does
not resolve. On a host whose /etc/resolv.conf search domain has a
wildcard A record, it does: libc appends the search domain, the wildcard
answers for nonexistent.invalid.<domain>, and the assertion inverts. The
test then fails on that host and nowhere else, which reads as a flake.

The name is now written absolute, with a trailing dot, so search-list
expansion never applies and the reserved .invalid TLD returns NXDOMAIN
from the root wherever the test runs. Verified on a host that reproduced
the failure: fails before, passes after.
This commit is contained in:
fr34aky
2026-09-10 23:47:22 +00:00
committed by Johnathan Corgan
parent 195fe1e700
commit a1c0cd42f5
+1 -1
View File
@@ -1029,7 +1029,7 @@ mod tests {
#[tokio::test]
async fn test_resolve_socket_addr_invalid() {
let invalid = TransportAddr::from_string("nonexistent.invalid:2121");
let invalid = TransportAddr::from_string("nonexistent.invalid.:2121");
assert!(resolve_socket_addr(&invalid).await.is_err());
let binary = TransportAddr::new(vec![0xff, 0x80]);