diff --git a/tests/e2e-cucumber/tests/e2e.rs b/tests/e2e-cucumber/tests/e2e.rs index 63a8f41d0..ffce42b90 100644 --- a/tests/e2e-cucumber/tests/e2e.rs +++ b/tests/e2e-cucumber/tests/e2e.rs @@ -1262,8 +1262,35 @@ fn load_expectations() -> e2e_cucumber::expectation::Expectations { .unwrap_or_else(|e| panic!("failed to parse expectations.toml: {e}")) } -#[tokio::main] -async fn main() { +/// Stack for the thread that drives the whole suite. +/// +/// The cucumber run is one future polled by `block_on` on the calling thread, so +/// every step future, and the evidence-gathering futures a failing serve step +/// awaits, is held on that thread's stack. Windows gives a main thread 1 MiB +/// against 8 MiB on Linux, and a stalled serve-06 overflowed it (#1003) instead +/// of reporting a failure. A spawned thread's stack is whatever is asked for here. +const SUITE_STACK_BYTES: usize = 64 * 1024 * 1024; + +fn main() { + let suite = std::thread::Builder::new() + .name("e2e-suite".to_owned()) + .stack_size(SUITE_STACK_BYTES) + .spawn(|| { + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .expect("failed to build the tokio runtime") + .block_on(run_suite()); + }) + .expect("failed to spawn the e2e suite thread"); + if let Err(payload) = suite.join() { + std::panic::resume_unwind(payload); + } +} + +// `block_on` needs no `Send`, and the cucumber writers held across awaits are not. +#[allow(clippy::future_not_send)] +async fn run_suite() { use std::collections::BTreeMap; use std::sync::Mutex;