diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..e2e5fa90e --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,11 @@ +[env] +# In unoptimised builds tokio tends to use a lot of stack space when +# creating some complicated futures, tokio has an open issue for this: +# https://github.com/tokio-rs/tokio/issues/2055. Some of our tests +# manage to not fit in the default 2MiB stack anymore due to this, so +# while the issue is not resolved we want to work around this. +# Because compiling optimised builds takes a very long time we prefer +# to avoid that. Setting this environment variable ensures that when +# invoking `cargo test` threads are allowed to have a large enough +# stack size without needing to use an optimised build. +RUST_MIN_STACK = "8388608" diff --git a/.github/workflows/jsonrpc.yml b/.github/workflows/jsonrpc.yml index 082ddb569..5b1781a46 100644 --- a/.github/workflows/jsonrpc.yml +++ b/.github/workflows/jsonrpc.yml @@ -8,6 +8,7 @@ on: env: CARGO_TERM_COLOR: always + RUST_MIN_STACK: "8388608" jobs: build_and_test: diff --git a/Cargo.toml b/Cargo.toml index 871ad9dbb..dd7f55fbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,9 @@ debug = 0 panic = 'abort' opt-level = 1 +[profile.test] +opt-level = 0 + [profile.release] lto = true panic = 'abort' diff --git a/deltachat-jsonrpc/typescript/test/test_base.ts b/deltachat-jsonrpc/typescript/test/test_base.ts index 71c79b235..3d6da6faa 100644 --- a/deltachat-jsonrpc/typescript/test/test_base.ts +++ b/deltachat-jsonrpc/typescript/test/test_base.ts @@ -30,7 +30,8 @@ export async function startServer(port: number = RPC_SERVER_PORT): Promise