Search code examples
rustsolanarust-tokiosolana-program-library

Tokio macro requires rt or rt-multi-thread in Solana program


Anyone able to guide me on why I can be getting this error on my tests?

The #[tokio::test] macro requires rt or rt-multi-thread.

It is more a Rust question than a Solana one, but I have been following the examples (and I am learning Rust), so just felt here would be a good place to post hte quesiton.

I have solana-program-test = "1.6.2".


Solution

  • Hrm... I'm not sure then. Maybe try adding https://github.com/solana-labs/solana/blob/364af3a3e01e258694e16aed57838d36305aa9c3/program-test/Cargo.toml#L25 explicitly?

    Under dev-dependencies though.