bolt icon indicating copy to clipboard operation
bolt copied to clipboard

[Bug] Test runs before the validator is ready

Open notdanilo opened this issue 1 year ago • 3 comments

Describe the bug

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

might run before the validator is ready with all the test setup.

To Reproduce Run bolt test several times until it happens :) it's an intermittent failure

Expected behavior Consistent tests

Screenshots

       InitializeNewWorld:
     Error: Simulation failed. 
Message: Transaction simulation failed: Error processing Instruction 0: invalid account data for instruction. 
Logs: 
[
  "Program WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n invoke [1]",
  "Program is not deployed",
  "Program WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n failed: invalid account data for instruction"
]. 
Catch the `SendTransactionError` and call `getLogs()` on it for full details.
      at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/src/connection.ts:6045:13)
      at processTicksAndRejections (node:internal/process/task_queues:105:5)
      at Connection.sendRawTransaction (node_modules/@solana/web3.js/src/connection.ts:6001:20)
      at sendAndConfirmRawTransaction (node_modules/@coral-xyz/anchor/src/provider.ts:377:21)
      at AnchorProvider.sendAndConfirm (node_modules/@coral-xyz/anchor/src/provider.ts:163:14)

notdanilo avatar Nov 30 '24 00:11 notdanilo

I am working around this locally by replacing the test command with sleep 5 && yarn .... I might push it if I don't find any better solution

notdanilo avatar Nov 30 '24 00:11 notdanilo

This can be really annoying for newcomers. I might include the workaround in the template asap

notdanilo avatar Dec 06 '24 15:12 notdanilo

An important note is that [test] startup_wait = 5000 is supposed to fix that, but it doesn't have any effect

notdanilo avatar Dec 06 '24 16:12 notdanilo

This is done

notdanilo avatar Jul 28 '25 15:07 notdanilo