Skip to content

Commit b1f5bb3

Browse files
committed
test(npm): connect via 127.0.0.1 in infrastructure smoke (Windows fix)
wiremock binds to 0.0.0.0 (the wildcard). Linux and macOS quietly route a connect to 0.0.0.0 onto the loopback interface, so the test worked on those runners. Windows refuses the connect with WSAEADDRNOTAVAIL (winsock error 10049) because 0.0.0.0 is a valid bind target but not a valid destination address. Use 127.0.0.1 explicitly for the smoke-check URL — the bound port from `server.address().port()` is still what we need. Assisted-by: Claude Code:opus-4-7
1 parent 8666684 commit b1f5bb3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

crates/socket-patch-cli/tests/docker_e2e_npm.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,13 @@ async fn npm_test_infrastructure_smoke() {
444444
let after_hash = git_sha256(PATCHED_BYTES);
445445
let server = make_mock_server(&after_hash).await;
446446
// Just hit one of the mock endpoints to confirm wiremock is up.
447+
// Connect via 127.0.0.1, not the server's bound IP — wiremock
448+
// binds to 0.0.0.0 (the wildcard), which is a valid bind address
449+
// but is NOT a valid destination address on Windows (WSAEADDRNOTAVAIL
450+
// / WSA error 10049). Linux/macOS quietly route 0.0.0.0 → loopback;
451+
// Windows doesn't.
447452
let url = format!(
448-
"http://{}:{}/v0/orgs/{ORG}/patches/blob/{after_hash}",
449-
server.address().ip(),
453+
"http://127.0.0.1:{}/v0/orgs/{ORG}/patches/blob/{after_hash}",
450454
server.address().port()
451455
);
452456
let body = reqwest::get(&url)

0 commit comments

Comments
 (0)