diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index bfa32978e..5e6fd0c67 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -11,7 +11,7 @@ concurrency: jobs: test-conformance: name: test-conformance - runs-on: [self-hosted, linux] + runs-on: ubuntu-latest steps: # Install and setup go - name: Set up Go 1.21 @@ -32,7 +32,7 @@ jobs: run: (go test -race -timeout 30m -failfast -v -p 2 ./cmd/interchaintest) || (echo "\n\n*****CHAIN and RELAYER LOGS*****" && cat "$HOME/.interchaintest/logs/interchaintest.log" && exit 1) test-ibc-examples: name: test-ibc-examples - runs-on: [self-hosted, linux] + runs-on: ubuntu-latest steps: # Install and setup go - name: Set up Go 1.21 @@ -54,7 +54,7 @@ jobs: run: go test -race -timeout 30m -failfast -v -p 2 ./examples/ibc test-cosmos-examples: name: test-cosmos-examples - runs-on: [self-hosted, linux] + runs-on: ubuntu-latest steps: # Install and setup go - name: Set up Go 1.21 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 6e3d75e49..c1933d219 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -11,7 +11,7 @@ concurrency: jobs: test-unit: name: unit-tests - runs-on: [self-hosted, linux] + runs-on: ubuntu-latest steps: # Install and setup go - name: Set up Go 1.21 diff --git a/chain/cosmos/broadcaster.go b/chain/cosmos/broadcaster.go index cc3eb9383..79c816305 100644 --- a/chain/cosmos/broadcaster.go +++ b/chain/cosmos/broadcaster.go @@ -14,7 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" - authTx "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/strangelove-ventures/interchaintest/v8/internal/dockerutil" "github.com/strangelove-ventures/interchaintest/v8/testutil" @@ -224,16 +224,22 @@ func BroadcastTx(ctx context.Context, broadcaster *Broadcaster, broadcastingUser return sdk.TxResponse{}, err } - resp, err := authTx.QueryTx(cc, respWithTxHash.TxHash) - if err != nil { - // if we fail to query the tx, it means an error occurred with the original message broadcast. - // we should return this instead. - originalResp, err := broadcaster.UnmarshalTxResponseBytes(ctx, txBytes) + return getFullyPopulatedResponse(cc, respWithTxHash.TxHash) +} + +// getFullyPopulatedResponse returns a fully populated sdk.TxResponse. +// the QueryTx function is periodically called until a tx with the given hash +// has been included in a block. +func getFullyPopulatedResponse(cc client.Context, txHash string) (sdk.TxResponse, error) { + var resp sdk.TxResponse + err := testutil.WaitForCondition(time.Second*60, time.Second*5, func() (bool, error) { + fullyPopulatedTxResp, err := authtx.QueryTx(cc, txHash) if err != nil { - return sdk.TxResponse{}, err + return false, nil } - return originalResp, nil - } - return *resp, nil + resp = *fullyPopulatedTxResp + return true, nil + }) + return resp, err }