repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

feat(harness): ureq replaces reqwest as the HTTP engine; tokio leaves the dependency graph

bca13c20b369c426d98be6db5fd7070a65999ea5

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (6)

+346 / −735 text lines

Diff layout

Cargo.lock

Modified

+40 / −666 text lines

143143 "syn 3.0.6",
146[[package]]
147name = "atomic-waker"
148version = "1.1.2"
149source = "registry+https://github.com/rust-lang/crates.io-index"
150checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
152146[[package]]
153147name = "autocfg"
154148version = "1.5.1"
155149source = "registry+https://github.com/rust-lang/crates.io-index"
156150checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
158[[package]]
159name = "aws-lc-rs"
160version = "1.18.1"
161source = "registry+https://github.com/rust-lang/crates.io-index"
162checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e"
163dependencies = [
164 "aws-lc-sys",
165 "zeroize",
166]
168[[package]]
169name = "aws-lc-sys"
170version = "0.45.0"
171source = "registry+https://github.com/rust-lang/crates.io-index"
172checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27"
173dependencies = [
174 "cc",
175 "cmake",
176 "dunce",
177 "fs_extra",
178 "pkg-config",
179]
181152[[package]]
182153name = "base64"
183154version = "0.23.1"
287258checksum = "f360145194ee8e21db5ee7f3fcd4fe52210864c75c985dae33218202c8bbe040"
288259dependencies = [
289260 "find-msvc-tools",
290 "jobserver",
291 "libc",
292261 "shlex",
304273source = "registry+https://github.com/rust-lang/crates.io-index"
305274checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"
307[[package]]
308name = "chacha20"
309version = "0.10.2"
310source = "registry+https://github.com/rust-lang/crates.io-index"
311checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"
312dependencies = [
313 "cfg-if",
314 "cpufeatures 0.3.1",
315 "rand_core",
316]
318276[[package]]
319277name = "ciborium"
320278version = "0.2.2"
382340source = "registry+https://github.com/rust-lang/crates.io-index"
383341checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486"
385[[package]]
386name = "cmake"
387version = "0.1.58"
388source = "registry+https://github.com/rust-lang/crates.io-index"
389checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678"
390dependencies = [
391 "cc",
392]
394343[[package]]
395344name = "cobs"
396345version = "0.3.0"
406355source = "registry+https://github.com/rust-lang/crates.io-index"
407356checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
409[[package]]
410name = "combine"
411version = "4.6.8"
412source = "registry+https://github.com/rust-lang/crates.io-index"
413checksum = "cfc320937d09e6de266b31b9afb480f197d7a861be86be7cb2ea7e5d1bfffc5e"
414dependencies = [
415 "bytes",
416 "memchr",
417]
419[[package]]
420name = "core-foundation"
421version = "0.10.1"
422source = "registry+https://github.com/rust-lang/crates.io-index"
423checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
424dependencies = [
425 "core-foundation-sys",
426 "libc",
427]
429[[package]]
430name = "core-foundation-sys"
431version = "0.8.7"
432source = "registry+https://github.com/rust-lang/crates.io-index"
433checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
435358[[package]]
436359name = "core_detect"
437360version = "1.0.0"
456379 "libc",
459[[package]]
460name = "cpufeatures"
461version = "0.3.1"
462source = "registry+https://github.com/rust-lang/crates.io-index"
463checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
464dependencies = [
465 "libc",
466]
468382[[package]]
469383name = "cranelift-assembler-x64"
470384version = "0.136.1"
745659 "syn 3.0.6",
748[[package]]
749name = "dunce"
750version = "1.0.5"
751source = "registry+https://github.com/rust-lang/crates.io-index"
752checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
754662[[package]]
755663name = "either"
756664version = "1.18.0"
856764 "winapi",
859[[package]]
860name = "fs_extra"
861version = "1.3.0"
862source = "registry+https://github.com/rust-lang/crates.io-index"
863checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
865767[[package]]
866768name = "futures"
867769version = "0.3.34"
967869checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
968870dependencies = [
969871 "cfg-if",
970 "js-sys",
971872 "libc",
972873 "wasi",
973 "wasm-bindgen",
976876[[package]]
980880checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
981881dependencies = [
982882 "cfg-if",
983 "js-sys",
984883 "libc",
985884 "r-efi",
986 "rand_core",
987 "wasm-bindgen",
990887[[package]]
1056953 "itoa",
1059[[package]]
1060name = "http-body"
1061version = "1.1.0"
1062source = "registry+https://github.com/rust-lang/crates.io-index"
1063checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"
1064dependencies = [
1065 "bytes",
1066 "http",
1069[[package]]
1070name = "http-body-util"
1071version = "0.1.5"
1072source = "registry+https://github.com/rust-lang/crates.io-index"
1073checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"
1074dependencies = [
1075 "bytes",
1076 "futures-core",
1077 "http",
1078 "http-body",
1079 "pin-project-lite",
1082956[[package]]
1083957name = "httparse"
1084958version = "1.10.1"
1085959source = "registry+https://github.com/rust-lang/crates.io-index"
1086960checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
1088[[package]]
1089name = "hyper"
1090version = "1.11.1"
1091source = "registry+https://github.com/rust-lang/crates.io-index"
1092checksum = "27b501faa50e7a26c3d3560ca625132f4078a17771f4810baf70475ae48cbe43"
1093dependencies = [
1094 "atomic-waker",
1095 "bytes",
1096 "futures-channel",
1097 "futures-core",
1098 "http",
1099 "http-body",
1100 "httparse",
1101 "itoa",
1102 "pin-project-lite",
1103 "smallvec",
1104 "tokio",
1105 "want",
1108[[package]]
1109name = "hyper-rustls"
1110version = "0.27.10"
1111source = "registry+https://github.com/rust-lang/crates.io-index"
1112checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53"
1113dependencies = [
1114 "http",
1115 "hyper",
1116 "hyper-util",
1117 "rustls",
1118 "tokio",
1119 "tokio-rustls",
1120 "tower-service",
1123[[package]]
1124name = "hyper-util"
1125version = "0.1.21"
1126source = "registry+https://github.com/rust-lang/crates.io-index"
1127checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"
1128dependencies = [
1129 "base64",
1130 "bytes",
1131 "futures-channel",
1132 "futures-util",
1133 "http",
1134 "http-body",
1135 "httparse",
1136 "hyper",
1137 "ipnet",
1138 "libc",
1139 "percent-encoding",
1140 "pin-project-lite",
1141 "socket2",
1142 "tokio",
1143 "tower-service",
1144 "tracing",
1147962[[package]]
1148963name = "icu_collections"
1149964version = "2.3.0"
12821097 "serde_core",
1285[[package]]
1286name = "ipnet"
1287version = "2.12.2"
1288source = "registry+https://github.com/rust-lang/crates.io-index"
1289checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0"
12911100[[package]]
12921101name = "is_terminal_polyfill"
12931102version = "1.70.2"
13181127source = "registry+https://github.com/rust-lang/crates.io-index"
13191128checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
1321[[package]]
1322name = "jni"
1323version = "0.22.4"
1324source = "registry+https://github.com/rust-lang/crates.io-index"
1325checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498"
1326dependencies = [
1327 "cfg-if",
1328 "combine",
1329 "jni-macros",
1330 "jni-sys",
1331 "log",
1332 "simd_cesu8",
1333 "thiserror 2.0.21",
1334 "walkdir",
1335 "windows-link",
1338[[package]]
1339name = "jni-macros"
1340version = "0.22.4"
1341source = "registry+https://github.com/rust-lang/crates.io-index"
1342checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3"
1343dependencies = [
1344 "proc-macro2",
1345 "quote",
1346 "rustc_version",
1347 "simd_cesu8",
1348 "syn 2.0.119",
1351[[package]]
1352name = "jni-sys"
1353version = "0.4.1"
1354source = "registry+https://github.com/rust-lang/crates.io-index"
1355checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2"
1356dependencies = [
1357 "jni-sys-macros",
1360[[package]]
1361name = "jni-sys-macros"
1362version = "0.4.1"
1363source = "registry+https://github.com/rust-lang/crates.io-index"
1364checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264"
1365dependencies = [
1366 "quote",
1367 "syn 2.0.119",
1370[[package]]
1371name = "jobserver"
1372version = "0.1.35"
1373source = "registry+https://github.com/rust-lang/crates.io-index"
1374checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
1375dependencies = [
1376 "getrandom 0.4.3",
1377 "libc",
13801130[[package]]
13811131name = "js-sys"
13821132version = "0.3.106"
14331183source = "registry+https://github.com/rust-lang/crates.io-index"
14341184checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
1436[[package]]
1437name = "lru-slab"
1438version = "0.1.3"
1439source = "registry+https://github.com/rust-lang/crates.io-index"
1440checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f"
14421186[[package]]
14431187name = "mach2"
14441188version = "0.6.0"
14601204 "rustix",
1463[[package]]
1464name = "mio"
1465version = "1.2.3"
1466source = "registry+https://github.com/rust-lang/crates.io-index"
1467checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8"
1468dependencies = [
1469 "libc",
1470 "wasi",
1471 "windows-sys 0.61.2",
14741207[[package]]
14751208name = "multiversion_no_op"
14761209version = "1.0.0"
15341267source = "registry+https://github.com/rust-lang/crates.io-index"
15351268checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
1537[[package]]
1538name = "openssl-probe"
1539version = "0.2.1"
1540source = "registry+https://github.com/rust-lang/crates.io-index"
1541checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
15431270[[package]]
15441271name = "option-ext"
15451272version = "0.2.0"
15771304source = "registry+https://github.com/rust-lang/crates.io-index"
15781305checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
1580[[package]]
1581name = "pkg-config"
1582version = "0.3.34"
1583source = "registry+https://github.com/rust-lang/crates.io-index"
1584checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
15861307[[package]]
15871308name = "plotters"
15881309version = "0.3.7"
17041425 "syn 2.0.119",
1707[[package]]
1708name = "quinn"
1709version = "0.11.12"
1710source = "registry+https://github.com/rust-lang/crates.io-index"
1711checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11"
1712dependencies = [
1713 "bytes",
1714 "cfg_aliases",
1715 "pin-project-lite",
1716 "quinn-proto",
1717 "quinn-udp",
1718 "rustc-hash",
1719 "rustls",
1720 "socket2",
1721 "thiserror 2.0.21",
1722 "tokio",
1723 "tracing",
1724 "web-time",
1727[[package]]
1728name = "quinn-proto"
1729version = "0.11.18"
1730source = "registry+https://github.com/rust-lang/crates.io-index"
1731checksum = "a9746dbde176634f4f2f1faf2404e30a31b2bc1e9cafb5329c95d8177a18c9fc"
1732dependencies = [
1733 "aws-lc-rs",
1734 "bytes",
1735 "getrandom 0.4.3",
1736 "lru-slab",
1737 "rand",
1738 "rand_pcg",
1739 "ring",
1740 "rustc-hash",
1741 "rustls",
1742 "rustls-pki-types",
1743 "slab",
1744 "thiserror 2.0.21",
1745 "tinyvec",
1746 "tracing",
1747 "web-time",
1750[[package]]
1751name = "quinn-udp"
1752version = "0.5.15"
1753source = "registry+https://github.com/rust-lang/crates.io-index"
1754checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694"
1755dependencies = [
1756 "cfg_aliases",
1757 "libc",
1758 "once_cell",
1759 "socket2",
1760 "tracing",
1761 "windows-sys 0.61.2",
17641428[[package]]
17651429name = "quote"
17661430version = "1.0.47"
17761440source = "registry+https://github.com/rust-lang/crates.io-index"
17771441checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
1779[[package]]
1780name = "rand"
1781version = "0.10.3"
1782source = "registry+https://github.com/rust-lang/crates.io-index"
1783checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"
1784dependencies = [
1785 "chacha20",
1786 "getrandom 0.4.3",
1787 "rand_core",
1790[[package]]
1791name = "rand_core"
1792version = "0.10.1"
1793source = "registry+https://github.com/rust-lang/crates.io-index"
1794checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
1796[[package]]
1797name = "rand_pcg"
1798version = "0.10.2"
1799source = "registry+https://github.com/rust-lang/crates.io-index"
1800checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a"
1801dependencies = [
1802 "rand_core",
18051443[[package]]
18061444name = "rayon"
18071445version = "1.12.0"
18761514source = "registry+https://github.com/rust-lang/crates.io-index"
18771515checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
1879[[package]]
1880name = "reqwest"
1881version = "0.13.5"
1882source = "registry+https://github.com/rust-lang/crates.io-index"
1883checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029"
1884dependencies = [
1885 "base64",
1886 "bytes",
1887 "futures-channel",
1888 "futures-core",
1889 "futures-util",
1890 "http",
1891 "http-body",
1892 "http-body-util",
1893 "hyper",
1894 "hyper-rustls",
1895 "hyper-util",
1896 "js-sys",
1897 "log",
1898 "percent-encoding",
1899 "pin-project-lite",
1900 "quinn",
1901 "rustls",
1902 "rustls-pki-types",
1903 "rustls-platform-verifier",
1904 "serde",
1905 "serde_json",
1906 "sync_wrapper",
1907 "tokio",
1908 "tokio-rustls",
1909 "tokio-util",
1910 "tower",
1911 "tower-http",
1912 "tower-service",
1913 "url",
1914 "wasm-bindgen",
1915 "wasm-bindgen-futures",
1916 "wasm-streams",
1917 "web-sys",
19201517[[package]]
19211518name = "ring"
19221519version = "0.17.14"
19431540source = "registry+https://github.com/rust-lang/crates.io-index"
19441541checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
1946[[package]]
1947name = "rustc_version"
1948version = "0.4.1"
1949source = "registry+https://github.com/rust-lang/crates.io-index"
1950checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
1951dependencies = [
1952 "semver",
19551543[[package]]
19561544name = "rustix"
19571545version = "1.1.5"
19711559source = "registry+https://github.com/rust-lang/crates.io-index"
19721560checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634"
19731561dependencies = [
1974 "aws-lc-rs",
1562 "log",
19751563 "once_cell",
1564 "ring",
19761565 "rustls-pki-types",
19771566 "rustls-webpki",
19781567 "subtle",
19791568 "zeroize",
1982[[package]]
1983name = "rustls-native-certs"
1984version = "0.8.4"
1985source = "registry+https://github.com/rust-lang/crates.io-index"
1986checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d"
1987dependencies = [
1988 "openssl-probe",
1989 "rustls-pki-types",
1990 "schannel",
1991 "security-framework",
19941571[[package]]
19951572name = "rustls-pki-types"
19961573version = "1.15.1"
19971574source = "registry+https://github.com/rust-lang/crates.io-index"
19981575checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
19991576dependencies = [
2000 "web-time",
20011577 "zeroize",
2004[[package]]
2005name = "rustls-platform-verifier"
2006version = "0.7.1"
2007source = "registry+https://github.com/rust-lang/crates.io-index"
2008checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98"
2009dependencies = [
2010 "core-foundation",
2011 "core-foundation-sys",
2012 "jni",
2013 "log",
2014 "once_cell",
2015 "rustls",
2016 "rustls-native-certs",
2017 "rustls-platform-verifier-android",
2018 "rustls-webpki",
2019 "security-framework",
2020 "security-framework-sys",
2021 "webpki-root-certs",
2022 "windows-sys 0.61.2",
2025[[package]]
2026name = "rustls-platform-verifier-android"
2027version = "0.2.0"
2028source = "registry+https://github.com/rust-lang/crates.io-index"
2029checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f"
20311580[[package]]
20321581name = "rustls-webpki"
20331582version = "0.103.15"
20341583source = "registry+https://github.com/rust-lang/crates.io-index"
20351584checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2"
20361585dependencies = [
2037 "aws-lc-rs",
20381586 "ring",
20391587 "rustls-pki-types",
20401588 "untrusted",
20551603 "winapi-util",
2058[[package]]
2059name = "schannel"
2060version = "0.1.29"
2061source = "registry+https://github.com/rust-lang/crates.io-index"
2062checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939"
2063dependencies = [
2064 "windows-sys 0.61.2",
20671606[[package]]
20681607name = "scopeguard"
20691608version = "1.2.0"
20701609source = "registry+https://github.com/rust-lang/crates.io-index"
20711610checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
2073[[package]]
2074name = "security-framework"
2075version = "3.7.0"
2076source = "registry+https://github.com/rust-lang/crates.io-index"
2077checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"
2078dependencies = [
2079 "bitflags",
2080 "core-foundation",
2081 "core-foundation-sys",
2082 "libc",
2083 "security-framework-sys",
2086[[package]]
2087name = "security-framework-sys"
2088version = "2.17.0"
2089source = "registry+https://github.com/rust-lang/crates.io-index"
2090checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"
2091dependencies = [
2092 "core-foundation-sys",
2093 "libc",
20961612[[package]]
20971613name = "semver"
20981614version = "1.0.28"
21851701checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
21861702dependencies = [
21871703 "cfg-if",
2188 "cpufeatures 0.2.17",
1704 "cpufeatures",
21891705 "digest",
21951711source = "registry+https://github.com/rust-lang/crates.io-index"
21961712checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
2198[[package]]
2199name = "simd_cesu8"
2200version = "1.2.0"
2201source = "registry+https://github.com/rust-lang/crates.io-index"
2202checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520"
2203dependencies = [
2204 "rustc_version",
2205 "simdutf8",
22081714[[package]]
22091715name = "simdutf8"
22101716version = "0.1.5"
22881794version = "0.1.0"
22891795dependencies = [
22901796 "futures",
2291 "reqwest",
22921797 "serde_json",
22931798 "smith",
22941799 "smith-ai",
22951800 "smith-core",
1801 "ureq",
22961802 "wasmtime",
23221828name = "smith-ui"
23231829version = "0.1.0"
2325[[package]]
2326name = "socket2"
2327version = "0.6.5"
2328source = "registry+https://github.com/rust-lang/crates.io-index"
2329checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
2330dependencies = [
2331 "libc",
2332 "windows-sys 0.61.2",
23351831[[package]]
23361832name = "stable_deref_trait"
23371833version = "1.2.1"
23721868 "unicode-ident",
2375[[package]]
2376name = "sync_wrapper"
2377version = "1.0.2"
2378source = "registry+https://github.com/rust-lang/crates.io-index"
2379checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
2380dependencies = [
2381 "futures-core",
23841871[[package]]
23851872name = "synstructure"
23861873version = "0.14.0"
24731960 "serde_json",
2476[[package]]
2477name = "tinyvec"
2478version = "1.13.3"
2479source = "registry+https://github.com/rust-lang/crates.io-index"
2480checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"
24821963[[package]]
24831964name = "tokio"
24841965version = "1.53.1"
24851966source = "registry+https://github.com/rust-lang/crates.io-index"
24861967checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
24871968dependencies = [
2488 "bytes",
2489 "libc",
2490 "mio",
24911969 "pin-project-lite",
2492 "socket2",
2493 "windows-sys 0.61.2",
2496[[package]]
2497name = "tokio-rustls"
2498version = "0.26.5"
2499source = "registry+https://github.com/rust-lang/crates.io-index"
2500checksum = "b0c85f2c3ef0b1cd58b36682f4b17aaa995f0e5db534d85692b4903abce21f67"
2501dependencies = [
2502 "rustls",
2503 "tokio",
2506[[package]]
2507name = "tokio-util"
2508version = "0.7.19"
2509source = "registry+https://github.com/rust-lang/crates.io-index"
2510checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52"
2511dependencies = [
2512 "bytes",
2513 "futures-core",
2514 "futures-sink",
2515 "pin-project-lite",
2516 "tokio",
25191972[[package]]
25572010source = "registry+https://github.com/rust-lang/crates.io-index"
25582011checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
2560[[package]]
2561name = "tower"
2562version = "0.5.3"
2563source = "registry+https://github.com/rust-lang/crates.io-index"
2564checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
2565dependencies = [
2566 "futures-core",
2567 "futures-util",
2568 "pin-project-lite",
2569 "sync_wrapper",
2570 "tokio",
2571 "tower-layer",
2572 "tower-service",
2575[[package]]
2576name = "tower-http"
2577version = "0.6.11"
2578source = "registry+https://github.com/rust-lang/crates.io-index"
2579checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840"
2580dependencies = [
2581 "bitflags",
2582 "bytes",
2583 "futures-util",
2584 "http",
2585 "http-body",
2586 "pin-project-lite",
2587 "tower",
2588 "tower-layer",
2589 "tower-service",
2590 "url",
2593[[package]]
2594name = "tower-layer"
2595version = "0.3.3"
2596source = "registry+https://github.com/rust-lang/crates.io-index"
2597checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
2599[[package]]
2600name = "tower-service"
2601version = "0.3.3"
2602source = "registry+https://github.com/rust-lang/crates.io-index"
2603checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
2605[[package]]
2606name = "tracing"
2607version = "0.1.44"
2608source = "registry+https://github.com/rust-lang/crates.io-index"
2609checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
2610dependencies = [
2611 "pin-project-lite",
2612 "tracing-core",
2615[[package]]
2616name = "tracing-core"
2617version = "0.1.36"
2618source = "registry+https://github.com/rust-lang/crates.io-index"
2619checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
2620dependencies = [
2621 "once_cell",
2624[[package]]
2625name = "try-lock"
2626version = "0.2.5"
2627source = "registry+https://github.com/rust-lang/crates.io-index"
2628checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
26302013[[package]]
26312014name = "typeid"
26322015version = "1.0.3"
26572040source = "registry+https://github.com/rust-lang/crates.io-index"
26582041checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
2043[[package]]
2044name = "ureq"
2045version = "3.4.2"
2046source = "registry+https://github.com/rust-lang/crates.io-index"
2047checksum = "9a7ac20be9b7726e0bbdbf974c059676d9acb1cd414961f570a4e8231cacd7fc"
2048dependencies = [
2049 "base64",
2050 "log",
2051 "percent-encoding",
2052 "rustls",
2053 "rustls-pki-types",
2054 "ureq-proto",
2055 "utf8-zero",
2056 "webpki-roots",
2059[[package]]
2060name = "ureq-proto"
2061version = "0.6.4"
2062source = "registry+https://github.com/rust-lang/crates.io-index"
2063checksum = "f86fd172ccca569e458f61b6bdd6220965a9ef36e672a6852953b51a0e1583be"
2064dependencies = [
2065 "base64",
2066 "http",
2067 "httparse",
2068 "log",
26602071[[package]]
26612072name = "url"
26622073version = "2.5.8"
26692080 "serde",
2083[[package]]
2084name = "utf8-zero"
2085version = "0.8.1"
2086source = "registry+https://github.com/rust-lang/crates.io-index"
2087checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e"
26722089[[package]]
26732090name = "utf8_iter"
26742091version = "1.0.4"
27182135 "winapi-util",
2721[[package]]
2722name = "want"
2723version = "0.3.1"
2724source = "registry+https://github.com/rust-lang/crates.io-index"
2725checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
2726dependencies = [
2727 "try-lock",
27302138[[package]]
27312139name = "wasi"
27322140version = "0.11.1+wasi-snapshot-preview1"
27462154 "wasm-bindgen-shared",
2749[[package]]
2750name = "wasm-bindgen-futures"
2751version = "0.4.79"
2752source = "registry+https://github.com/rust-lang/crates.io-index"
2753checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e"
2754dependencies = [
2755 "js-sys",
2756 "tokio",
2757 "wasm-bindgen",
27602157[[package]]
27612158name = "wasm-bindgen-macro"
27622159version = "0.2.129"
28332230 "wasmparser 0.259.0",
2836[[package]]
2837name = "wasm-streams"
2838version = "0.5.0"
2839source = "registry+https://github.com/rust-lang/crates.io-index"
2840checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb"
2841dependencies = [
2842 "futures-util",
2843 "js-sys",
2844 "wasm-bindgen",
2845 "wasm-bindgen-futures",
2846 "web-sys",
28492233[[package]]
28502234name = "wasmparser"
28512235version = "0.258.0"
30972481[[package]]
3098name = "web-time"
3099version = "1.1.0"
3100source = "registry+https://github.com/rust-lang/crates.io-index"
3101checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
3102dependencies = [
3103 "js-sys",
3104 "wasm-bindgen",
3107[[package]]
3108name = "webpki-root-certs"
2482name = "webpki-roots"
31092483version = "1.0.9"
31102484source = "registry+https://github.com/rust-lang/crates.io-index"
3111checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b"
2485checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a"
31122486dependencies = [
31132487 "rustls-pki-types",

Cargo.toml

Modified

+2 / −5 text lines

5252url = "2"
5454# engines
55reqwest = { version = "0.13", default-features = false, features = [
56 "json",
57 "stream",
58 "blocking",
55ureq = { version = "~3.4", default-features = false, features = [
5956 "rustls",
60] } # smith-harness, http stack
57] } # smith-harness, http stack; tilde pin: the chunk-gap timeout uses ureq::unversioned
6158ciborium = "0.2" # smith-core, cbor session codec
6259wasmtime = { version = "49", default-features = false, features = [
6360 "runtime",

TO_DISCUSS.md

Modified

+1 / −1 text lines

1717## Rethinks
19- 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`).
19- 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.
2121- Benchmarking: regression detection + learning, relative comparisons, in-repo baselines, no machine-specific numbers. Trigger: RELS planning.
2222- SDK-layer bindings: deferred past 1.0; world must stay comfortable through raw wit-bindgen. Trigger: 1.0 stabilization.

smith-harness/Cargo.toml

Modified

+1 / −1 text lines

1313smith-ai = { path = "../smith-ai", version = "0.1.0" }
1414wasmtime = { workspace = true }
1515futures = { workspace = true }
16reqwest = { workspace = true }
16ureq = { workspace = true }
1818[dev-dependencies]
1919serde_json = { workspace = true }

smith-harness/src/http.rs

Modified

+142 / −62 text lines

1010use std::sync::Arc;
1111use std::sync::mpsc;
1212use std::time::Duration;
13use ureq::unversioned::resolver::DefaultResolver;
14use ureq::unversioned::transport::{
15 Buffers, ConnectionDetails, Connector, DefaultConnector, NextTimeout, Transport,
16};
1418/// Largest accepted response body, in bytes.
1519pub const MAX_BODY_BYTES: u64 = 64 * 1024 * 1024;
2327/// Deadline for one chunk gap.
2428pub const CHUNK_TIMEOUT: Duration = Duration::from_secs(300);
26/// `reqwest`-backed executor; the only HTTP engine in the workspace.
30/// The HTTP engine: `ureq`, blocking, pure Rust, no async runtime
31/// (`SMH-SPEC-SPEC0001`, network transport).
2732#[derive(Clone)]
28pub struct ReqwestHttpExecutor {
29 client: reqwest::blocking::Client,
33pub struct UreqHttpExecutor {
34 agent: ureq::Agent,
32impl ReqwestHttpExecutor {
33 /// A default executor with head and chunk timeouts.
37impl UreqHttpExecutor {
38 /// A default executor with [`HEAD_TIMEOUT`] and [`CHUNK_TIMEOUT`].
3439 #[must_use]
3540 pub fn new() -> Self {
36 Self {
37 client: reqwest::blocking::Client::builder()
38 .timeout(HEAD_TIMEOUT + CHUNK_TIMEOUT)
39 .build()
40 .unwrap_or_default(),
41 }
41 Self::with_timeouts(HEAD_TIMEOUT, CHUNK_TIMEOUT)
4242 }
44 /// Wrap an existing client, primarily for tests.
44 /// An executor bounding connect plus response head by `head` and every
45 /// socket wait after that by `gap`.
4546 #[must_use]
46 pub const fn with_client(client: reqwest::blocking::Client) -> Self {
47 Self { client }
47 pub fn with_timeouts(head: Duration, gap: Duration) -> Self {
48 let config = ureq::Agent::config_builder()
49 .http_status_as_error(false)
50 .timeout_connect(Some(head))
51 .timeout_recv_response(Some(head))
52 .build();
53 let connector = DefaultConnector::default().chain(GapTimeout(gap));
54 Self {
55 agent: ureq::Agent::with_parts(config, connector, DefaultResolver::default()),
56 }
4857 }
51impl Default for ReqwestHttpExecutor {
60impl Default for UreqHttpExecutor {
5261 fn default() -> Self {
5362 Self::new()
5463 }
57impl HttpExecutor for ReqwestHttpExecutor {
66impl HttpExecutor for UreqHttpExecutor {
5867 fn execute(&self, exchange: HttpExchange, cancel: CancelHandle) -> Result<HttpResponse> {
59 if exchange.body.len() > MAX_REQUEST_BYTES {
60 return Err(bounded("request body exceeds the size bound"));
61 }
62 if cancel.is_cancelled() {
63 return Err(SmithError::Cancelled);
64 }
65 let method = match exchange.method {
66 smith::http::HttpMethod::Post => reqwest::Method::POST,
68 admit(&exchange, &cancel)?;
69 let mut prepared = match exchange.method {
70 smith::http::HttpMethod::Post => self.agent.post(&exchange.url),
6771 };
68 let mut prepared = self
69 .client
70 .request(method, &exchange.url)
71 .body(exchange.body.clone())
72 .timeout(HEAD_TIMEOUT);
7372 for header in &exchange.headers {
7473 prepared = prepared.header(&header.name, &header.value);
7574 }
76 let mut response = prepared
77 .send()
75 let response = prepared
76 .send(&exchange.body[..])
7877 .map_err(|e| transport_fault(&e.to_string()))?;
7978 let head = HttpHead {
8079 status: response.status().as_u16(),
8180 };
82 let (sender, receiver) = mpsc::channel();
83 let cancel_stream = cancel;
84 std::thread::spawn(move || {
85 let mut buffer = [0u8; 16 * 1024];
86 let mut total: u64 = 0;
87 loop {
88 if cancel_stream.is_cancelled() {
89 return;
90 }
91 let read = match response.read(&mut buffer) {
92 Ok(0) | Err(_) => return,
93 Ok(read) => read,
94 };
95 total += u64::try_from(read).unwrap_or(u64::MAX);
96 if total > MAX_BODY_BYTES {
97 return;
98 }
99 if sender
100 .send(HttpChunk {
101 bytes: buffer[..read].to_vec(),
102 })
103 .is_err()
104 {
105 return;
106 }
107 }
108 });
109 Ok(HttpResponse {
81 Ok(stream_body(
11082 head,
111 chunks: receiver,
112 })
83 response.into_body().into_reader(),
84 cancel,
85 ))
86 }
87}
89/// Connector stage capping every socket wait at a gap duration, so a
90/// stalled body fails per gap instead of per whole-body budget.
91#[derive(Debug)]
92struct GapTimeout(Duration);
94impl Connector<Box<dyn Transport>> for GapTimeout {
95 type Out = GapTransport;
97 fn connect(
98 &self,
99 _details: &ConnectionDetails,
100 chained: Option<Box<dyn Transport>>,
101 ) -> std::result::Result<Option<Self::Out>, ureq::Error> {
102 Ok(chained.map(|inner| GapTransport { inner, gap: self.0 }))
103 }
104}
106#[derive(Debug)]
107struct GapTransport {
108 inner: Box<dyn Transport>,
109 gap: Duration,
110}
112impl GapTransport {
113 fn cap(&self, timeout: NextTimeout) -> NextTimeout {
114 NextTimeout {
115 after: timeout.after.min(self.gap.into()),
116 reason: timeout.reason,
117 }
118 }
119}
121impl Transport for GapTransport {
122 fn buffers(&mut self) -> &mut dyn Buffers {
123 self.inner.buffers()
124 }
126 fn transmit_output(
127 &mut self,
128 amount: usize,
129 timeout: NextTimeout,
130 ) -> std::result::Result<(), ureq::Error> {
131 let timeout = self.cap(timeout);
132 self.inner.transmit_output(amount, timeout)
133 }
135 fn await_input(&mut self, timeout: NextTimeout) -> std::result::Result<bool, ureq::Error> {
136 let timeout = self.cap(timeout);
137 self.inner.await_input(timeout)
138 }
140 fn is_open(&mut self) -> bool {
141 self.inner.is_open()
142 }
144 fn is_tls(&self) -> bool {
145 self.inner.is_tls()
113146 }
116149/// The shared default executor.
117150#[must_use]
118151pub fn default_executor() -> HttpExecutorRef {
119 Arc::new(ReqwestHttpExecutor::new())
152 Arc::new(UreqHttpExecutor::new())
153}
155fn admit(exchange: &HttpExchange, cancel: &CancelHandle) -> Result<()> {
156 if exchange.body.len() > MAX_REQUEST_BYTES {
157 return Err(bounded("request body exceeds the size bound"));
158 }
159 if cancel.is_cancelled() {
160 return Err(SmithError::Cancelled);
161 }
162 Ok(())
163}
165/// Pump `body` into ordered chunks on a reader thread.
166///
167/// The channel closes at end of body, on read error, past
168/// [`MAX_BODY_BYTES`], or once `cancel` fires; no chunk read after
169/// cancellation is delivered.
170fn stream_body(
171 head: HttpHead,
172 mut body: impl Read + Send + 'static,
173 cancel: CancelHandle,
174) -> HttpResponse {
175 let (sender, receiver) = mpsc::channel();
176 std::thread::spawn(move || {
177 let mut buffer = [0u8; 16 * 1024];
178 let mut total: u64 = 0;
179 loop {
180 let read = match body.read(&mut buffer) {
181 Ok(0) | Err(_) => return,
182 Ok(read) => read,
183 };
184 total += u64::try_from(read).unwrap_or(u64::MAX);
185 if cancel.is_cancelled() || total > MAX_BODY_BYTES {
186 return;
187 }
188 let chunk = HttpChunk {
189 bytes: buffer[..read].to_vec(),
190 };
191 if sender.send(chunk).is_err() {
192 return;
193 }
194 }
195 });
196 HttpResponse {
197 head,
198 chunks: receiver,
199 }
122202fn transport_fault(message: &str) -> SmithError {

smith-harness/tests/http_stream.rs

Added
new file mode 100644

+160 / −0 text lines

1//! Streaming, cancellation, size-bound, and timeout semantics of the HTTP
2//! engine against a real loopback socket (`SMH-SPEC-SPEC0001`, network transport).
3
4use smith::http::{HttpExchange, HttpExecutor, HttpMethod, HttpResponse};
5use smith::tool::CancelHandle;
6use smith_harness::http::{MAX_BODY_BYTES, UreqHttpExecutor};
7use std::io::{Read, Write};
8use std::net::{TcpListener, TcpStream};
9use std::sync::mpsc::RecvTimeoutError;
10use std::time::{Duration, Instant};
12const EVENTS: [&str; 3] = ["data: one\n\n", "data: two\n\n", "data: three\n\n"];
13const EVENT_GAP: Duration = Duration::from_millis(200);
15/// Accept one connection, read the request head, hand the socket to
16/// `serve`, then drain until the client closes so unread request bytes
17/// never turn the close into a reset that discards in-flight response data.
18fn spawn_server(serve: impl FnOnce(&mut TcpStream) + Send + 'static) -> u16 {
19 let listener = TcpListener::bind("127.0.0.1:0").unwrap();
20 let port = listener.local_addr().unwrap().port();
21 std::thread::spawn(move || {
22 let (mut socket, _) = listener.accept().unwrap();
23 let mut buffer = [0u8; 8192];
24 let _ = socket.read(&mut buffer);
25 serve(&mut socket);
26 let _ = socket.shutdown(std::net::Shutdown::Write);
27 let _ = std::io::copy(&mut socket, &mut std::io::sink());
28 });
29 port
30}
32/// Chunked SSE: head plus first event at once, later events after `EVENT_GAP`.
33fn serve_events(socket: &mut TcpStream) {
34 let head = "HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\n\
35 Transfer-Encoding: chunked\r\nConnection: close\r\n\r\n";
36 let _ = socket.write_all(head.as_bytes());
37 for (index, event) in EVENTS.iter().enumerate() {
38 if index > 0 {
39 std::thread::sleep(EVENT_GAP);
40 }
41 let _ = write!(socket, "{:x}\r\n{event}\r\n", event.len());
42 let _ = socket.flush();
43 }
44 let _ = socket.write_all(b"0\r\n\r\n");
45}
47fn post(executor: &dyn HttpExecutor, port: u16, cancel: CancelHandle) -> HttpResponse {
48 let exchange = HttpExchange {
49 method: HttpMethod::Post,
50 url: format!("http://127.0.0.1:{port}/v1/chat/completions"),
51 headers: Vec::new(),
52 body: b"{}".to_vec(),
53 };
54 executor.execute(exchange, cancel).unwrap()
55}
57#[test]
58fn chunks_arrive_incrementally() {
59 let executor = UreqHttpExecutor::new();
60 let port = spawn_server(serve_events);
61 let start = Instant::now();
62 let response = post(&executor, port, CancelHandle::new());
63 assert_eq!(response.head.status, 200);
64 let arrivals: Vec<(Duration, Vec<u8>)> = response
65 .chunks
66 .iter()
67 .map(|chunk| (start.elapsed(), chunk.bytes))
68 .collect();
69 let body: Vec<u8> = arrivals.iter().flat_map(|(_, b)| b.clone()).collect();
70 assert_eq!(body, EVENTS.concat().as_bytes());
71 let first = arrivals.first().unwrap().0;
72 let last = arrivals.last().unwrap().0;
73 assert!(first < EVENT_GAP, "first chunk at {first:?}");
74 assert!(
75 last - first >= EVENT_GAP * 3 / 2,
76 "chunks bunched ({first:?}..{last:?})"
77 );
78}
80#[test]
81fn cancel_after_first_chunk_stops_the_reader() {
82 let executor = UreqHttpExecutor::new();
83 let port = spawn_server(serve_events);
84 let cancel = CancelHandle::new();
85 let response = post(&executor, port, cancel.clone());
86 let first = response.chunks.recv().unwrap();
87 assert_eq!(first.bytes, EVENTS[0].as_bytes());
88 cancel.cancel();
89 let cancelled_at = Instant::now();
90 // The reader delivers nothing read after cancellation and exits
91 // once its in-flight read returns: within one event gap.
92 let next = response.chunks.recv_timeout(EVENT_GAP * 2);
93 let stopped = cancelled_at.elapsed();
94 assert_eq!(next, Err(RecvTimeoutError::Disconnected));
95 assert!(stopped < EVENT_GAP * 3 / 2, "stopped after {stopped:?}");
96}
98#[test]
99fn body_over_bound_is_cut_off() {
100 let oversized = MAX_BODY_BYTES + 1024 * 1024;
101 let executor = UreqHttpExecutor::new();
102 let port = spawn_server(move |socket| {
103 let head = format!("HTTP/1.1 200 OK\r\nContent-Length: {oversized}\r\n\r\n");
104 let _ = socket.write_all(head.as_bytes());
105 let block = vec![b'x'; 64 * 1024];
106 let mut sent = 0;
107 while sent < oversized && socket.write_all(&block).is_ok() {
108 sent += block.len() as u64;
109 }
110 });
111 let response = post(&executor, port, CancelHandle::new());
112 let received: u64 = response
113 .chunks
114 .iter()
115 .map(|chunk| chunk.bytes.len() as u64)
116 .sum();
117 assert!(received <= MAX_BODY_BYTES, "received {received}");
118 assert!(received > MAX_BODY_BYTES - 64 * 1024, "received {received}");
119}
121#[test]
122fn ureq_gap_timeout_ends_a_stalled_body() {
123 let gap = Duration::from_millis(300);
124 let executor = UreqHttpExecutor::with_timeouts(Duration::from_secs(5), gap);
125 let port = spawn_server(|socket| {
126 let head = "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n";
127 let _ = socket.write_all(head.as_bytes());
128 // Keep streaming for longer than `gap` in total, but stall once.
129 for pause in [100, 100, 100, 1_000] {
130 let _ = socket.write_all(b"2\r\nok\r\n");
131 std::thread::sleep(Duration::from_millis(pause));
132 }
133 let _ = socket.write_all(b"5\r\nlate!\r\n0\r\n\r\n");
134 });
135 let start = Instant::now();
136 let response = post(&executor, port, CancelHandle::new());
137 let body: Vec<u8> = response.chunks.iter().flat_map(|c| c.bytes).collect();
138 let ended = start.elapsed();
139 assert_eq!(body, b"okokokok");
140 assert!(ended >= Duration::from_millis(600), "ended at {ended:?}");
141 assert!(ended < Duration::from_millis(1_000), "ended at {ended:?}");
142}
144#[test]
145fn ureq_head_timeout_fails_the_exchange() {
146 let head = Duration::from_millis(300);
147 let executor = UreqHttpExecutor::with_timeouts(head, Duration::from_secs(5));
148 let port = spawn_server(|_| std::thread::sleep(Duration::from_secs(2)));
149 let exchange = HttpExchange {
150 method: HttpMethod::Post,
151 url: format!("http://127.0.0.1:{port}/"),
152 headers: Vec::new(),
153 body: Vec::new(),
154 };
155 let start = Instant::now();
156 let result = executor.execute(exchange, CancelHandle::new());
157 let failed = start.elapsed();
158 assert!(result.is_err());
159 assert!(failed < Duration::from_secs(1), "failed at {failed:?}");
160}