Repository: bytecodealliance/wasmtime
Pull request #8265 (2024-03-29 19:16:55)

Add another allowed error for `http_outbound_request_timeout`
I'm not sure why the test fails this way locally, but I spuriously was receiving a "connection refused" error instead of a "connection timeout" error. I've updated the test case to accept either error here to fix the spurious errors I'm seeing locally.

<!--
Please make sure you include the following information:

- If this work has been discussed elsewhere, please include a link to that
  conversation. If it was discussed in an issue, just mention "issue #...".

- Explain why this change is needed. If the details are in an issue already,
  this can be brief.

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->



Patch:
diff --git a/Cargo.toml b/Cargo.toml
index 58a359d77..6eb24c977 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -274,7 +274,7 @@ walkdir = "2.3.3"
 cfg-if = "1.0"
 tempfile = "3.1.0"
 filecheck = "0.5.0"
-libc = "0.2.60"
+libc = { version = "0.2.112", default-features = true }
 file-per-thread-logger = "0.2.0"
 tokio = { version = "1.26.0", features = [ "rt", "time" ] }
 hyper = "1.0.1"
@@ -290,6 +290,7 @@ test-log = { version = "0.2", default-features = false, features = ["trace"] }
 tracing-subscriber = { version = "0.3.1", default-features = false, features = ['fmt', 'env-filter', 'ansi', 'tracing-log'] }
 url = "2.3.1"
 humantime = "2.0.0"
+bincode = "1.2.1"
 
 # =============================================================================
 #
diff --git a/cranelift/codegen/Cargo.toml b/cranelift/codegen/Cargo.toml
index b6b915fc1..237165214 100644
--- a/cranelift/codegen/Cargo.toml
+++ b/cranelift/codegen/Cargo.toml
@@ -26,9 +26,9 @@ cranelift-control = { workspace = true }
 hashbrown = { workspace = true, features = ["raw"] }
 target-lexicon = { workspace = true }
 log = { workspace = true }
-serde = { version = "1.0.188", optional = true }
-serde_derive = { version = "1.0.188", optional = true }
-bincode = { version = "1.2.1", optional = true }
+serde = { workspace = true, optional = true }
+serde_derive = { workspace = true, optional = true }
+bincode = { workspace = true, optional = true }
 gimli = { workspace = true, features = ["write"], optional = true }
 smallvec = { workspace = true }
 regalloc2 = { workspace = true, features = ["checker"] }
diff --git a/cranelift/entity/Cargo.toml b/cranelift/entity/Cargo.toml
index c0d9ade9c..c3d4fd591 100644
--- a/cranelift/entity/Cargo.toml
+++ b/cranelift/entity/Cargo.toml
@@ -15,8 +15,8 @@ edition.workspace = true
 workspace = true
 
 [dependencies]
-serde = { version = "1.0.188", optional = true }
-serde_derive = { version = "1.0.188", optional = true }
+serde = { workspace = true, optional = true }
+serde_derive = { workspace = true, optional = true }
 
 [features]
 enable-serde = ["serde", "serde_derive"]
diff --git a/cranelift/jit/Cargo.toml b/cranelift/jit/Cargo.toml
index 1bdeecea4..45fffb02c 100644
--- a/cranelift/jit/Cargo.toml
+++ b/cranelift/jit/Cargo.toml
@@ -20,7 +20,7 @@ cranelift-entity = { workspace = true }
 cranelift-control = { workspace = true }
 anyhow = { workspace = true }
 region = "2.2.0"
-libc = { version = "0.2.42" }
+libc = { workspace = true }
 target-lexicon = { workspace = true }
 memmap2 = { version = "0.2.1", optional = true }
 log = { workspace = true }
diff --git a/cranelift/module/Cargo.toml b/cranelift/module/Cargo.toml
index 1d6b49dfe..365e258c5 100644
--- a/cranelift/module/Cargo.toml
+++ b/cranelift/module/Cargo.toml
@@ -18,8 +18,8 @@ cranelift-codegen = { workspace = true }
 cranelift-control = { workspace = true }
 hashbrown = { workspace = true, optional = true }
 anyhow = { workspace = true }
-serde = { version = "1.0.188", optional = true }
-serde_derive = { version = "1.0.188", optional = true }
+serde = { workspace = true, optional = true }
+serde_derive = { workspace = true, optional = true }
 
 [features]
 default = ["std"]
diff --git a/cranelift/native/Cargo.toml b/cranelift/native/Cargo.toml
index ccab301fd..2fad8a457 100644
--- a/cranelift/native/Cargo.toml
+++ b/cranelift/native/Cargo.toml
@@ -15,7 +15,7 @@ cranelift-codegen = { workspace = true }
 target-lexicon = { workspace = true }
 
 [target.'cfg(any(target_arch = "s390x", target_arch = "riscv64"))'.dependencies]
-libc = "0.2.95"
+libc = { workspace = true }
 
 [features]
 default = ["std"]
diff --git a/cranelift/serde/Cargo.toml b/cranelift/serde/Cargo.toml
index 3f81e697e..9a6b1ca53 100644
--- a/cranelift/serde/Cargo.toml
+++ b/cranelift/serde/Cargo.toml
@@ -18,6 +18,6 @@ path = "src/clif-json.rs"
 
 [dependencies]
 clap = { workspace = true }
-serde_json = "1.0.26"
+serde_json = { workspace = true }
 cranelift-codegen = { workspace = true, features = ["enable-serde"] }
 cranelift-reader = { workspace = true }
diff --git a/cranelift/wasm/Cargo.toml b/cranelift/wasm/Cargo.toml
index 115618cf2..f9b561c93 100644
--- a/cranelift/wasm/Cargo.toml
+++ b/cranelift/wasm/Cargo.toml
@@ -23,8 +23,8 @@ wasmtime-types = { workspace = true }
 hashbrown = { workspace = true, optional = true }
 itertools = "0.12.0"
 log = { workspace = true }
-serde = { version = "1.0.188", optional = true }
-serde_derive = { version = "1.0.188", optional = true }
+serde = { workspace = true, optional = true }
+serde_derive = { workspace = true, optional = true }
 smallvec = { workspace = true }
 
 [dev-dependencies]
diff --git a/crates/cache/Cargo.toml b/crates/cache/Cargo.toml
index 5156afc35..475f3828e 100644
--- a/crates/cache/Cargo.toml
+++ b/crates/cache/Cargo.toml
@@ -14,11 +14,11 @@ workspace = true
 [dependencies]
 anyhow = { workspace = true }
 base64 = "0.21.0"
-bincode = "1.1.4"
+bincode = { workspace = true }
 directories-next = "2.0"
 log = { workspace = true }
-serde = "1.0.188"
-serde_derive = "1.0.188"
+serde = { workspace = true }
+serde_derive = { workspace = true }
 sha2 = "0.10.2"
 toml = { workspace = true }
 zstd = { version = "0.13.0", default-features = false }
diff --git a/crates/environ/Cargo.toml b/crates/environ/Cargo.toml
index 748a17aef..c0a78b943 100644
--- a/crates/environ/Cargo.toml
+++ b/crates/environ/Cargo.toml
@@ -15,15 +15,15 @@ workspace = true
 
 [dependencies]
 anyhow = { workspace = true }
-bincode = "1.2.1"
+bincode = { workspace = true }
 cpp_demangle = { version = "0.4.3", optional = true }
 cranelift-entity = { workspace = true }
 wasmtime-types = { workspace = true }
 wasmparser = { workspace = true }
 indexmap = { workspace = true, features = ["serde"] }
 thiserror = { workspace = true }
-serde = "1.0.188"
-serde_derive = "1.0.188"
+serde = { workspace = true }
+serde_derive = { workspace = true }
 log = { workspace = true }
 gimli = { workspace = true }
 object = { workspace = true }
diff --git a/crates/jit-icache-coherence/Cargo.toml b/crates/jit-icache-coherence/Cargo.toml
index 729db45dd..8fcbcc280 100644
--- a/crates/jit-icache-coherence/Cargo.toml
+++ b/crates/jit-icache-coherence/Cargo.toml
@@ -23,7 +23,7 @@ features = [
 ]
 
 [target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android"))'.dependencies]
-libc = "0.2.42"
+libc = { workspace = true }
 
 [features]
 # Most modern CPUs are SMP (multicore). However, when only one core is present,
diff --git a/crates/runtime/Cargo.toml b/crates/runtime/Cargo.toml
index f53a5d7ab..27831e71f 100644
--- a/crates/runtime/Cargo.toml
+++ b/crates/runtime/Cargo.toml
@@ -20,7 +20,7 @@ wasmtime-environ = { workspace = true }
 wasmtime-fiber = { workspace = true, optional = true }
 wasmtime-jit-debug = { workspace = true, features = ["gdb_jit_int"], optional = true }
 wasmtime-versioned-export-macros = { workspace = true }
-libc = { version = "0.2.112", default-features = false }
+libc = { workspace = true }
 log = { workspace = true }
 memoffset = "0.9.0"
 indexmap = { workspace = true }
diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml
index 33925d7b0..8adf5ca53 100644
--- a/crates/types/Cargo.toml
+++ b/crates/types/Cargo.toml
@@ -10,7 +10,7 @@ edition.workspace = true
 
 [dependencies]
 cranelift-entity = { workspace = true, features = ['enable-serde'] }
-serde = "1.0.188"
-serde_derive = "1.0.188"
+serde = { workspace = true }
+serde_derive = { workspace = true }
 thiserror = { workspace = true }
 wasmparser = { workspace = true }
diff --git a/crates/wasmtime/Cargo.toml b/crates/wasmtime/Cargo.toml
index 367c4fcf5..07e72b0fa 100644
--- a/crates/wasmtime/Cargo.toml
+++ b/crates/wasmtime/Cargo.toml
@@ -37,14 +37,14 @@ target-lexicon = { workspace = true }
 wasmparser = { workspace = true }
 wasm-encoder = { workspace = true, optional = true }
 anyhow = { workspace = true }
-libc = "0.2"
+libc = { workspace = true }
 cfg-if = { workspace = true }
 log = { workspace = true }
 wat = { workspace = true, optional = true }
-serde = "1.0.188"
-serde_derive = "1.0.188"
+serde = { workspace = true }
+serde_derive = { workspace = true }
 serde_json = { workspace = true }
-bincode = "1.2.1"
+bincode = { workspace = true }
 indexmap = { workspace = true }
 paste = "1.0.3"
 once_cell = { workspace = true }


Test patch:
diff --git a/crates/test-programs/src/bin/http_outbound_request_timeout.rs b/crates/test-programs/src/bin/http_outbound_request_timeout.rs
index 198288e48..ae0dac512 100644
--- a/crates/test-programs/src/bin/http_outbound_request_timeout.rs
+++ b/crates/test-programs/src/bin/http_outbound_request_timeout.rs
@@ -22,11 +22,12 @@ fn main() {
     .context("/get");
 
     assert!(res.is_err());
+    let err = res.unwrap_err();
     assert!(
         matches!(
-            res.unwrap_err().downcast_ref::<ErrorCode>(),
-            Some(ErrorCode::ConnectionTimeout)
+            err.downcast_ref::<ErrorCode>(),
+            Some(ErrorCode::ConnectionTimeout | ErrorCode::ConnectionRefused)
         ),
-        "expected connection timeout"
+        "expected connection timeout: {err:?}"
     );
 }