0

I have a problem when testing the solana chain. I successfully built the solana repo, but after if i do a ./cargo test, i fall on this error: error: test failed, to rerun pass `-p solana-cli --test program`

This solves nothing: ./cargo test -p solana-cli --test program` .
I tried the trick by adding -j 3 till -j 1 at the end, in case, but impossible to get out of the error. Do you have an idea? Below is the error in context:

(...)
Compiling solana-unified-scheduler-pool v1.18.0 (/home/davis/github/blockchains/solana-labs/solana/unified-scheduler-pool)
Compiling solana-test-validator v1.18.0 (/home/davis/github/blockchains/solana-labs/solana/test-validator)
  Finished test [unoptimized + debuginfo] target(s) in 21m 17s
  Running tests/program.rs (target/debug/deps/program-a54c0c8c9ee79c36)

running 12 tests
error: test failed, to rerun pass `-p solana-cli --test program`

Caused by:
  process didn't exit successfully: `/home/davis/github/blockchains/solana-labs/solana/target/debug/deps/program-a54c0c8c9ee79c36` (signal: 9, SIGKILL: kill)
davis@********:~/github/blockchains/solana-labs/solana$

Extensive researches on the web = 0. I tried on my WSL ubuntu 20 + ubuntu 22: same error.

Ubuntu 22.04.3 LTS (WSL)
rustc 1.76.0
rustup 1.26.0
rustfmt 1.7.0-stable
cargo 1.76.0
rustup toolchain: stable-x86_64-unknown-linux-gnu (default)
solana-cli 1.18.1

1 Answer 1

1

The error unfortunately says it all:

process didn't exit successfully: `/home/davis/github/blockchains/solana-labs/solana/target/debug/deps/program-a54c0c8c9ee79c36` (signal: 9, SIGKILL: kill)

If your program received a kill -9, then probably the OOM killer had to step in.

Building and running the tests are two separate steps, so using -j 1 you were able to build everything, but then the test will still try to run everything in parallel, which is overloading the machine.

The CLI tests can be extremely heavy because they each run separate test validators in-process, so it's normal to OOM while running them.

To get around that, you'll need to isolate just the test you want to run by doing:

./cargo test -p solana-cli --test program -- <TEST_TO_RUN>

where <TEST_TO_RUN> is the full name of the test in the test file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.