feat(harness): ureq replaces reqwest as the HTTP engine; tokio leaves the dependency graph
bca13c20b369c426d98be6db5fd7070a65999ea5
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 4d5af16fc879
There are many coding harnesses - but this one is fast
bca13c20b369c426d98be6db5fd7070a65999ea5
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+346 / −735 text lines
+40 / −666 text lines
[[package]]name = "aws-lc-rs"version = "1.18.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e"dependencies = [ "aws-lc-sys", "zeroize",][[package]]name = "aws-lc-sys"version = "0.45.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27"dependencies = [ "cc", "cmake", "dunce", "fs_extra", "pkg-config",][[package]]name = "combine"version = "4.6.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cfc320937d09e6de266b31b9afb480f197d7a861be86be7cb2ea7e5d1bfffc5e"dependencies = [ "bytes", "memchr",][[package]]name = "core-foundation"version = "0.10.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"dependencies = [ "core-foundation-sys", "libc",][[package]]name = "core-foundation-sys"version = "0.8.7"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" "js-sys", "wasm-bindgen", "js-sys",[[package]]name = "http-body"version = "1.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"dependencies = [ "bytes", "http",][[package]]name = "http-body-util"version = "0.1.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"dependencies = [ "bytes", "futures-core", "http", "http-body", "pin-project-lite",][[package]]name = "hyper"version = "1.11.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "27b501faa50e7a26c3d3560ca625132f4078a17771f4810baf70475ae48cbe43"dependencies = [ "atomic-waker", "bytes", "futures-channel", "futures-core", "http", "http-body", "httparse", "itoa", "pin-project-lite", "smallvec", "tokio", "want",][[package]]name = "hyper-rustls"version = "0.27.10"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53"dependencies = [ "http", "hyper", "hyper-util", "rustls", "tokio", "tokio-rustls", "tower-service",][[package]]name = "hyper-util"version = "0.1.21"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"dependencies = [ "base64", "bytes", "futures-channel", "futures-util", "http", "http-body", "httparse", "hyper", "ipnet", "libc", "percent-encoding", "pin-project-lite", "socket2", "tokio", "tower-service", "tracing",][[package]]name = "jni"version = "0.22.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498"dependencies = [ "cfg-if", "combine", "jni-macros", "jni-sys", "log", "simd_cesu8", "thiserror 2.0.21", "walkdir", "windows-link",][[package]]name = "jni-macros"version = "0.22.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3"dependencies = [ "proc-macro2", "quote", "rustc_version", "simd_cesu8", "syn 2.0.119",][[package]]name = "jni-sys"version = "0.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2"dependencies = [ "jni-sys-macros",][[package]]name = "jni-sys-macros"version = "0.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264"dependencies = [ "quote", "syn 2.0.119",][[package]]name = "jobserver"version = "0.1.35"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"dependencies = [ "getrandom 0.4.3", "libc",][[package]]name = "quinn"version = "0.11.12"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11"dependencies = [ "bytes", "cfg_aliases", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", "rustls", "socket2", "thiserror 2.0.21", "tokio", "tracing", "web-time",][[package]]name = "quinn-proto"version = "0.11.18"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "a9746dbde176634f4f2f1faf2404e30a31b2bc1e9cafb5329c95d8177a18c9fc"dependencies = [ "aws-lc-rs", "bytes", "getrandom 0.4.3", "lru-slab", "rand", "rand_pcg", "ring", "rustc-hash", "rustls", "rustls-pki-types", "slab", "thiserror 2.0.21", "tinyvec", "tracing", "web-time",][[package]]name = "quinn-udp"version = "0.5.15"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694"dependencies = [ "cfg_aliases", "libc", "once_cell", "socket2", "tracing", "windows-sys 0.61.2",][[package]]name = "rand"version = "0.10.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"dependencies = [ "chacha20", "getrandom 0.4.3", "rand_core",][[package]]name = "rand_core"version = "0.10.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"[[package]]name = "rand_pcg"version = "0.10.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a"dependencies = [ "rand_core",][[package]]name = "reqwest"version = "0.13.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029"dependencies = [ "base64", "bytes", "futures-channel", "futures-core", "futures-util", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", "hyper-util", "js-sys", "log", "percent-encoding", "pin-project-lite", "quinn", "rustls", "rustls-pki-types", "rustls-platform-verifier", "serde", "serde_json", "sync_wrapper", "tokio", "tokio-rustls", "tokio-util", "tower", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys",] "ring",[[package]]name = "rustls-native-certs"version = "0.8.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d"dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", "security-framework",] "web-time",[[package]]name = "rustls-platform-verifier"version = "0.7.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98"dependencies = [ "core-foundation", "core-foundation-sys", "jni", "log", "once_cell", "rustls", "rustls-native-certs", "rustls-platform-verifier-android", "rustls-webpki", "security-framework", "security-framework-sys", "webpki-root-certs", "windows-sys 0.61.2",][[package]]name = "rustls-platform-verifier-android"version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" "aws-lc-rs",[[package]]name = "security-framework"version = "3.7.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"dependencies = [ "bitflags", "core-foundation", "core-foundation-sys", "libc", "security-framework-sys",][[package]]name = "security-framework-sys"version = "2.17.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"dependencies = [ "core-foundation-sys", "libc",] "reqwest", "ureq", "socket2", "windows-sys 0.61.2",][[package]]name = "tokio-rustls"version = "0.26.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b0c85f2c3ef0b1cd58b36682f4b17aaa995f0e5db534d85692b4903abce21f67"dependencies = [ "rustls", "tokio",][[package]]name = "tokio-util"version = "0.7.19"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52"dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio",[[package]]name = "tower"version = "0.5.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"dependencies = [ "futures-core", "futures-util", "pin-project-lite", "sync_wrapper", "tokio", "tower-layer", "tower-service",][[package]]name = "tower-http"version = "0.6.11"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840"dependencies = [ "bitflags", "bytes", "futures-util", "http", "http-body", "pin-project-lite", "tower", "tower-layer", "tower-service", "url",][[package]]name = "tower-layer"version = "0.3.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"[[package]]name = "tower-service"version = "0.3.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"[[package]]name = "tracing"version = "0.1.44"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"dependencies = [ "pin-project-lite", "tracing-core",][[package]]name = "tracing-core"version = "0.1.36"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"dependencies = [ "once_cell",][[package]]name = "try-lock"version = "0.2.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"[[package]]name = "ureq"version = "3.4.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9a7ac20be9b7726e0bbdbf974c059676d9acb1cd414961f570a4e8231cacd7fc"dependencies = [ "base64", "log", "percent-encoding", "rustls", "rustls-pki-types", "ureq-proto", "utf8-zero", "webpki-roots",][[package]]name = "ureq-proto"version = "0.6.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f86fd172ccca569e458f61b6bdd6220965a9ef36e672a6852953b51a0e1583be"dependencies = [ "base64", "http", "httparse", "log",][[package]]name = "wasm-streams"version = "0.5.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb"dependencies = [ "futures-util", "js-sys", "wasm-bindgen", "wasm-bindgen-futures", "web-sys",]name = "web-time"version = "1.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"dependencies = [ "js-sys", "wasm-bindgen",][[package]]name = "webpki-root-certs"name = "webpki-roots"+2 / −5 text lines
+1 / −1 text lines
- Guest std ergonomics: sandboxed wasi shims (environment, poll, clocks) land on demand per spec; cargo-component adapters versus smith implementations decided at the tooling slice (`smith plugin build`).- Guest std ergonomics: sealed wasi shims for io, clocks, cli landed (SMH-SPEC-WASM0001 Sealed WASI); random, wall-clock, filesystem, sockets substitutes land on demand when a guest needs them. Trigger: first non-echo guest failing instantiation.+1 / −1 text lines
+142 / −62 text lines
/// `reqwest`-backed executor; the only HTTP engine in the workspace. Self { client: reqwest::blocking::Client::builder() .timeout(HEAD_TIMEOUT + CHUNK_TIMEOUT) .build() .unwrap_or_default(), } Self::with_timeouts(HEAD_TIMEOUT, CHUNK_TIMEOUT) /// Wrap an existing client, primarily for tests. pub fn with_timeouts(head: Duration, gap: Duration) -> Self { let config = ureq::Agent::config_builder() .http_status_as_error(false) .timeout_connect(Some(head)) .timeout_recv_response(Some(head)) .build(); let connector = DefaultConnector::default().chain(GapTimeout(gap)); Self { agent: ureq::Agent::with_parts(config, connector, DefaultResolver::default()), } let (sender, receiver) = mpsc::channel(); let cancel_stream = cancel; std::thread::spawn(move || { let mut buffer = [0u8; 16 * 1024]; let mut total: u64 = 0; loop { if cancel_stream.is_cancelled() { return; } let read = match response.read(&mut buffer) { Ok(0) | Err(_) => return, Ok(read) => read, }; total += u64::try_from(read).unwrap_or(u64::MAX); if total > MAX_BODY_BYTES { return; } if sender .send(HttpChunk { bytes: buffer[..read].to_vec(), }) .is_err() { return; } } }); Ok(HttpResponse { Ok(stream_body( response.into_body().into_reader(), cancel, )) }}/// Connector stage capping every socket wait at a gap duration, so a/// stalled body fails per gap instead of per whole-body budget.#[derive(Debug)]struct GapTimeout(Duration);impl Connector<Box<dyn Transport>> for GapTimeout { type Out = GapTransport; fn connect( &self, _details: &ConnectionDetails, chained: Option<Box<dyn Transport>>, ) -> std::result::Result<Option<Self::Out>, ureq::Error> { Ok(chained.map(|inner| GapTransport { inner, gap: self.0 })) }}#[derive(Debug)]struct GapTransport { inner: Box<dyn Transport>, gap: Duration,}impl GapTransport { fn cap(&self, timeout: NextTimeout) -> NextTimeout { NextTimeout { after: timeout.after.min(self.gap.into()), reason: timeout.reason, } }}impl Transport for GapTransport { fn buffers(&mut self) -> &mut dyn Buffers { self.inner.buffers() } fn transmit_output( &mut self, amount: usize, timeout: NextTimeout, ) -> std::result::Result<(), ureq::Error> { let timeout = self.cap(timeout); self.inner.transmit_output(amount, timeout) } fn await_input(&mut self, timeout: NextTimeout) -> std::result::Result<bool, ureq::Error> { let timeout = self.cap(timeout); self.inner.await_input(timeout) } fn is_open(&mut self) -> bool { self.inner.is_open() } fn is_tls(&self) -> bool { self.inner.is_tls() Arc::new(ReqwestHttpExecutor::new()) Arc::new(UreqHttpExecutor::new())}fn admit(exchange: &HttpExchange, cancel: &CancelHandle) -> Result<()> { if exchange.body.len() > MAX_REQUEST_BYTES { return Err(bounded("request body exceeds the size bound")); } if cancel.is_cancelled() { return Err(SmithError::Cancelled); } Ok(())}/// Pump `body` into ordered chunks on a reader thread.////// The channel closes at end of body, on read error, past/// [`MAX_BODY_BYTES`], or once `cancel` fires; no chunk read after/// cancellation is delivered.fn stream_body( head: HttpHead, mut body: impl Read + Send + 'static, cancel: CancelHandle,) -> HttpResponse { let (sender, receiver) = mpsc::channel(); std::thread::spawn(move || { let mut buffer = [0u8; 16 * 1024]; let mut total: u64 = 0; loop { let read = match body.read(&mut buffer) { Ok(0) | Err(_) => return, Ok(read) => read, }; total += u64::try_from(read).unwrap_or(u64::MAX); if cancel.is_cancelled() || total > MAX_BODY_BYTES { return; } let chunk = HttpChunk { bytes: buffer[..read].to_vec(), }; if sender.send(chunk).is_err() { return; } } }); HttpResponse { head, chunks: receiver, }new file mode 100644+160 / −0 text lines
//! Streaming, cancellation, size-bound, and timeout semantics of the HTTP//! engine against a real loopback socket (`SMH-SPEC-SPEC0001`, network transport).use smith::http::{HttpExchange, HttpExecutor, HttpMethod, HttpResponse};use smith::tool::CancelHandle;use smith_harness::http::{MAX_BODY_BYTES, UreqHttpExecutor};use std::io::{Read, Write};use std::net::{TcpListener, TcpStream};use std::sync::mpsc::RecvTimeoutError;use std::time::{Duration, Instant};const EVENTS: [&str; 3] = ["data: one\n\n", "data: two\n\n", "data: three\n\n"];const EVENT_GAP: Duration = Duration::from_millis(200);/// Accept one connection, read the request head, hand the socket to/// `serve`, then drain until the client closes so unread request bytes/// never turn the close into a reset that discards in-flight response data.fn spawn_server(serve: impl FnOnce(&mut TcpStream) + Send + 'static) -> u16 { let listener = TcpListener::bind("127.0.0.1:0").unwrap(); let port = listener.local_addr().unwrap().port(); std::thread::spawn(move || { let (mut socket, _) = listener.accept().unwrap(); let mut buffer = [0u8; 8192]; let _ = socket.read(&mut buffer); serve(&mut socket); let _ = socket.shutdown(std::net::Shutdown::Write); let _ = std::io::copy(&mut socket, &mut std::io::sink()); }); port}/// Chunked SSE: head plus first event at once, later events after `EVENT_GAP`.fn serve_events(socket: &mut TcpStream) { let head = "HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\n\ Transfer-Encoding: chunked\r\nConnection: close\r\n\r\n"; let _ = socket.write_all(head.as_bytes()); for (index, event) in EVENTS.iter().enumerate() { if index > 0 { std::thread::sleep(EVENT_GAP); } let _ = write!(socket, "{:x}\r\n{event}\r\n", event.len()); let _ = socket.flush(); } let _ = socket.write_all(b"0\r\n\r\n");}fn post(executor: &dyn HttpExecutor, port: u16, cancel: CancelHandle) -> HttpResponse { let exchange = HttpExchange { method: HttpMethod::Post, url: format!("http://127.0.0.1:{port}/v1/chat/completions"), headers: Vec::new(), body: b"{}".to_vec(), }; executor.execute(exchange, cancel).unwrap()}#[test]fn chunks_arrive_incrementally() { let executor = UreqHttpExecutor::new(); let port = spawn_server(serve_events); let start = Instant::now(); let response = post(&executor, port, CancelHandle::new()); assert_eq!(response.head.status, 200); let arrivals: Vec<(Duration, Vec<u8>)> = response .chunks .iter() .map(|chunk| (start.elapsed(), chunk.bytes)) .collect(); let body: Vec<u8> = arrivals.iter().flat_map(|(_, b)| b.clone()).collect(); assert_eq!(body, EVENTS.concat().as_bytes()); let first = arrivals.first().unwrap().0; let last = arrivals.last().unwrap().0; assert!(first < EVENT_GAP, "first chunk at {first:?}"); assert!( last - first >= EVENT_GAP * 3 / 2, "chunks bunched ({first:?}..{last:?})" );}#[test]fn cancel_after_first_chunk_stops_the_reader() { let executor = UreqHttpExecutor::new(); let port = spawn_server(serve_events); let cancel = CancelHandle::new(); let response = post(&executor, port, cancel.clone()); let first = response.chunks.recv().unwrap(); assert_eq!(first.bytes, EVENTS[0].as_bytes()); cancel.cancel(); let cancelled_at = Instant::now(); // The reader delivers nothing read after cancellation and exits // once its in-flight read returns: within one event gap. let next = response.chunks.recv_timeout(EVENT_GAP * 2); let stopped = cancelled_at.elapsed(); assert_eq!(next, Err(RecvTimeoutError::Disconnected)); assert!(stopped < EVENT_GAP * 3 / 2, "stopped after {stopped:?}");}#[test]fn body_over_bound_is_cut_off() { let oversized = MAX_BODY_BYTES + 1024 * 1024; let executor = UreqHttpExecutor::new(); let port = spawn_server(move |socket| { let head = format!("HTTP/1.1 200 OK\r\nContent-Length: {oversized}\r\n\r\n"); let _ = socket.write_all(head.as_bytes()); let block = vec![b'x'; 64 * 1024]; let mut sent = 0; while sent < oversized && socket.write_all(&block).is_ok() { sent += block.len() as u64; } }); let response = post(&executor, port, CancelHandle::new()); let received: u64 = response .chunks .iter() .map(|chunk| chunk.bytes.len() as u64) .sum(); assert!(received <= MAX_BODY_BYTES, "received {received}"); assert!(received > MAX_BODY_BYTES - 64 * 1024, "received {received}");}#[test]fn ureq_gap_timeout_ends_a_stalled_body() { let gap = Duration::from_millis(300); let executor = UreqHttpExecutor::with_timeouts(Duration::from_secs(5), gap); let port = spawn_server(|socket| { let head = "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n"; let _ = socket.write_all(head.as_bytes()); // Keep streaming for longer than `gap` in total, but stall once. for pause in [100, 100, 100, 1_000] { let _ = socket.write_all(b"2\r\nok\r\n"); std::thread::sleep(Duration::from_millis(pause)); } let _ = socket.write_all(b"5\r\nlate!\r\n0\r\n\r\n"); }); let start = Instant::now(); let response = post(&executor, port, CancelHandle::new()); let body: Vec<u8> = response.chunks.iter().flat_map(|c| c.bytes).collect(); let ended = start.elapsed(); assert_eq!(body, b"okokokok"); assert!(ended >= Duration::from_millis(600), "ended at {ended:?}"); assert!(ended < Duration::from_millis(1_000), "ended at {ended:?}");}#[test]fn ureq_head_timeout_fails_the_exchange() { let head = Duration::from_millis(300); let executor = UreqHttpExecutor::with_timeouts(head, Duration::from_secs(5)); let port = spawn_server(|_| std::thread::sleep(Duration::from_secs(2))); let exchange = HttpExchange { method: HttpMethod::Post, url: format!("http://127.0.0.1:{port}/"), headers: Vec::new(), body: Vec::new(), }; let start = Instant::now(); let result = executor.execute(exchange, CancelHandle::new()); let failed = start.elapsed(); assert!(result.is_err()); assert!(failed < Duration::from_secs(1), "failed at {failed:?}");}