Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions tests/e2e-cucumber/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading