3
Unable to get latest blockhash. Test validator does not look started.
Check .anchor/test-ledger/test-ledger-log.txt for errors. Consider
increasing [test.startup_wait] in Anchor.toml.

This shows up whenever I try to run anchor test command.

Anchor.toml:

[features]
seeds = false
[programs.localnet]
anchor = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"

[registry]
url = "https://anchor.projectserum.com"

[provider]
cluster = "localnet"
wallet = "/root/.config/solana/id.json"

[scripts]
test = "node tests/fandom.js"

[test]
startup_wait = 10000

I tried adding

[test]

startup_wait = 1000000

to the bottom of Anchor.toml but it just gets stuck on

Running test suite: "/mnt/c/dev/Blockchain/buildspace/darth-fandom/anchor/Anchor.toml"
5
  • Can you post the validator setup in Anchor.toml?
    – yamen
    Commented Jul 15, 2022 at 6:29
  • @yamen edited the description to add it Commented Jul 15, 2022 at 6:44
  • Have you tried running solana-test-validator manually? Will it start? If not, please post the output you are getting. Commented Jul 22, 2022 at 5:48
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Jul 22, 2022 at 5:49
  • What did .anchor/test-ledger/test-ledger-log.txt say?
    – mikemaccana
    Commented Apr 12 at 14:49

2 Answers 2

2

Solved this by deleting target folder and re-running anchor test. Error occurred due to renaming test file.

Edit: An older earlier compiled file was running instead of the new one.

3
  • Was anchor trying to run an older test?
    – Jacob Creech
    Commented Jul 16, 2022 at 0:07
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jul 17, 2022 at 16:47
  • @JacobCreech yes. It was using an earlier compiled file. Commented Jul 24, 2022 at 18:00
2

Alternatively,

Run

anchor clean

To get rid of the build artefacts without deleting your deploy folder inside target

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.