From 69e49922f3ae811525d49a4b5a709e4695d301cf Mon Sep 17 00:00:00 2001 From: juhovainio Date: Tue, 10 Nov 2026 11:32:22 +0200 Subject: [PATCH] test(e2e): run the cucumber suite on a large-stack thread The suite is one future polled on the calling thread, so its step and failure-evidence futures live on that thread's stack. Windows main threads get 1 MiB, and a stalled serve-06 overflowed it instead of reporting the failure. Drive the suite from a 64 MiB thread. Signed-off-by: juhovainio --- tests/e2e-cucumber/tests/e2e.rs | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/e2e-cucumber/tests/e2e.rs b/tests/e2e-cucumber/tests/e2e.rs index 63a8f41d00..ffce42b904 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;