algorand / go-algorand-sdk

Algorand Golang SDK
https://pkg.go.dev/github.com/algorand/go-algorand-sdk/v2
MIT License
185 stars 95 forks source link

Tests: Fix funding for cucumber tests by rotating sender accounts #630

Closed jasonpaulos closed 3 months ago

jasonpaulos commented 4 months ago

Our integration tests have been failing with this message recently:

Feature: Indexer Client v2 Responses

--- Failed steps:

  Scenario: Simulating bad inner transactions in the ATC # features/integration/simulate.feature:84
    And I fund the current application's address with 10000000 microalgos. # features/integration/simulate.feature:99
      Error: HTTP 400: {"message":"TransactionPool.Remember: transaction EACAUS4SOXATJGT4L3GNPA4CYGZQPPY7HEZISHVHGECG7RIBQUQA: overspend (account AUTSR2JLL6WZT76LJDPLCWABDL7VGDJB7AIVNR3YE5V47VD6KGY2QGHH34, data {AccountBaseData:{Status:Not Participating MicroAlgos:{Raw:8759477} RewardsBase:0 RewardedMicroAlgos:{Raw:0} AuthAddr:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ IncentiveEligible:false TotalAppSchema:{_struct:{} NumUint:0 NumByteSlice:0} TotalExtraAppPages:0 TotalAppParams:0 TotalAppLocalStates:0 TotalAssetParams:0 TotalAssets:0 TotalBoxes:0 TotalBoxBytes:0 LastProposed:0 LastHeartbeat:0} VotingData:{VoteID:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] SelectionID:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] StateProofID:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] VoteFirstValid:0 VoteLastValid:0 VoteKeyDilution:0}}, tried to spend {10000000})"}

71 scenarios (70 passed, 1 failed)
1293 steps (1272 passed, 1 failed, 20 skipped)

Example: https://app.circleci.com/pipelines/github/algorand/go-algorand-sdk/1211/workflows/86f710d6-8844-450e-a730-b8af05f95ca0/jobs/2585

This PR attempts to solve the issue by drawing algos from all of the accounts (I believe there are 3 or 4 available) instead of always using the same account.