Debugging Tips
itest - Investigating Flaky Tests
itest - Investigating Flaky TestsWe developed a tool called itest to help with debugging flaky tests. It runs the same test iteratively.
itest Usage
itest UsageRun the following command to see the usage of itest:
./tools/scripts/itest.shitest Example
itest ExampleThe following is an example of itest in action to run the TxClient_SignAndBroadcast_Succeeds test in the pkg/client/tx 50 times in total (5 consecutive tests over 10 runs).
make itest 5 10 ./pkg/client/tx/... -- -run TxClient_SignAndBroadcast_Succeedspocketd query tx - Investigating Failed Transactions
pocketd query tx - Investigating Failed Transactionstl;dr Submitted Transaction != Committed Transaction
After a transaction (e.g. staking a new service) is successfully sent to an RPC node, we have to wait until the next block, when a proposer will try to commit to the network's state, to see if it's valid. If the transaction's (TX) state transition is invalid, it will not be committed.
In other words, receiving a transaction (TX) hash from the pocketd CLI doesn't mean it was committed. However, the transaction (TX) hash can be used to investigate the failed transaction.
pocketd query tx Example
pocketd query tx ExampleThe following is an example of pocketd query tx in action to investigate a failed transaction. In this example, the command to add a new service is executed as follows, returning the TX hash shown. However, the service does not appear in the list of services when querying the full node.
The TX hash is returned by the above command:
To investigate this issue, the following command is used to get the details of the transaction:
Which shows the following log entry:
The output above shows the cause of the transaction failure: insufficient funds. Fixing this by adding more funds to the corresponding supplier account will allow the transaction to result in the expected state transition.
If you are reading this and the 9E4CA... hash is no longer valid, we may have done a re-genesis of TestNet at this point. Please consider updating with a new one!
Was this helpful?
