kevinheavey / solana-bankrun

Superfast Solana Tests for Node.js
https://kevinheavey.github.io/solana-bankrun/
Apache License 2.0
86 stars 8 forks source link

Garbled program names when using concurrent jest tests #2

Open kevinheavey opened 10 months ago

kevinheavey commented 10 months ago

When this repo's tests are run concurrently (the default Jest option), around 5% of the time a test will fail because the program name is garbled:. The error looks like this: Program file data not available for ��w�ld (11111111111111111111111111111112).

Logging reveals that the program name is fine when startInner is called in JS, but the name is already garbled when logged at the top of the Rust start function. So it seems to be a problem with sending the string from JS to Rust.

When you use the --runInBand Jest flag this doesn't happen.

I tried reproducing with just an async function that takes an AddedProgram[] parameter like the start function does, but the strings in this function never got garbled in testing.

This could be specific to Jest or it may happen with other testing frameworks.