Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7961

"Error: No such file or directory (os error 2)" Error from Anchor Test

$
0
0

enter image description here

My tests all run successfully, but at the end of my test execution, I get error Error: No such file or directory (os error 2).

On the anchor discord, I found a thread from February detailing the same issue I had discord link.I recently also added another program to my anchor project, similar to the user who posted on discord, but I only saw this error after upgrading to anchor anchor-cli 0.25.0 and solana solana-cli 1.10.32.

My Anchor.toml has the following. I get the error both in CI and locally, and both environments have ts-mocha and yarn installed.

[scripts]test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 --parallel"

Edit: Looks like it might be a race condition?Removing the parallel flag I now get the below. So I still get the error, but it happens before the success.

Error: No such file or directory (os error 2)✨  Done in 432.44s.

Edit: Looks like the issue is with multi-programs, or at least the way I have them setup. Removing whirlpool from the directory structure removes the issue.enter image description here

Edit: Fixed!!!I needed this in my dummy whirlpool program

#[program]pub mod whirlpool {    use super::*;    // _val to ensure tx are different so they don't get rejected.    pub fn initialize(_ctx: Context<Initialize>, _val: u64) -> Result<()> {        Ok(())    }}#[derive(Accounts)]pub struct Initialize {}

Viewing all articles
Browse latest Browse all 7961

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>