From afaa29de741540386408bcb216c59f23c13aaccf Mon Sep 17 00:00:00 2001 From: Alex Todorov Date: Thu, 7 Nov 2024 18:04:02 +0200 Subject: [PATCH] Don't build/test binaries with cargo test to workaround OOM issues what I am seeing with the move to Linode VMs is essentially this: https://github.com/rust-lang/cargo/issues/9157 https://github.com/rust-lang/cargo/issues/12912 B/c these new VMs have more CPU cores, 16 (new) vs 4(old), compilation is faster however this causes cargo to be overzealous and spawn too many linker processes which consume all of the available memory (on a 64 GB VM) and causes an OOM error forcing the kernel to kill the linker process and causing cargo to fail! Another alternative, which works, is using `--jobs 8`, however that is less optimal b/c it leaves unused CPU capacity and also affects the number of parallel threads when executing the test suite! WARNING: using `--release` is not an option because it breaks tests. The polkadot-sdk code uses the macro defensive! which is designed to panic when running in debug mode and multiple test scenarios rely on this behavior via #[should_panic]! WARNING: we still need the 64 GB memory! --- .github/workflows/gluwa.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gluwa.yml b/.github/workflows/gluwa.yml index 8154ea70813ab..b4de43b78c4fb 100644 --- a/.github/workflows/gluwa.yml +++ b/.github/workflows/gluwa.yml @@ -140,7 +140,7 @@ jobs: uses: gluwa/cargo@dev with: command: test - args: --features runtime-benchmarks + args: --features runtime-benchmarks --lib rm-gh-runner-cargo-check: runs-on: ubuntu-latest