Skip to content

Commit

Permalink
Don't build/test binaries with cargo test to workaround OOM issues
Browse files Browse the repository at this point in the history
what I am seeing with the move to Linode VMs is essentially this:
rust-lang/cargo#9157
rust-lang/cargo#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!
  • Loading branch information
atodorov committed Nov 15, 2024
1 parent 27dbcf8 commit afaa29d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/gluwa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit afaa29d

Please sign in to comment.