Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fail fast in expectTxSuccess and expectTxFail #1014

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.9.1-0.20241001093137-16a09b708612
github.com/tonistiigi/go-rosetta v0.0.0-20220804170347-3f4430f2d346
go.uber.org/zap v1.27.0
golang.org/x/sync v0.8.0
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.9.1-0.20241001093137-16a09b708612 h1:Rbt7CDy7JrdMBJgaiwJfb4rLFF8AiEO0G6XD+tMDZME=
github.com/stretchr/testify v1.9.1-0.20241001093137-16a09b708612/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4=
Expand Down
3 changes: 2 additions & 1 deletion test/driver/cli_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (d *KwilCliDriver) TxSuccess(_ context.Context, txHash []byte) error {
out, err := mustRun[respTxQuery](cmd, d.logger)
if err != nil {
if strings.Contains(err.Error(), "not found") {
return ErrTxNotConfirmed // not quite, but for this driver it's a retry condition
return ErrTxNotFound // This is what we need to solve! See the docs on this error type.
}
return fmt.Errorf("failed to query tx: %w", err)
}
Expand Down Expand Up @@ -609,6 +609,7 @@ func (d *KwilCliDriver) TxInfo(ctx context.Context, hash []byte) (*transactions.
out, err := mustRun[*transactions.TcTxQueryResponse](cmd, d.logger)
if err != nil {
if strings.Contains(err.Error(), "transaction not found") {
fmt.Println("TX NOT FOUND in TxInfo!")
// try again, hacking around comet's mempool inconsistency
time.Sleep(500 * time.Millisecond)
res2, err := mustRun[*transactions.TcTxQueryResponse](cmd, d.logger)
Expand Down
3 changes: 2 additions & 1 deletion test/driver/client_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (d *KwildClientDriver) TxSuccess(ctx context.Context, txHash []byte) error
resp, err := d.clt.TxQuery(ctx, txHash)
if err != nil {
if errors.Is(err, rpcclient.ErrNotFound) {
return ErrTxNotConfirmed // not quite, but for this driver it's a retry condition
return ErrTxNotFound // fix this
}
return fmt.Errorf("failed to query: %w", err)
}
Expand Down Expand Up @@ -233,6 +233,7 @@ func (d *KwildClientDriver) TxInfo(ctx context.Context, hash []byte) (*transacti
res, err := d.clt.TxQuery(ctx, hash)
if err != nil {
if strings.Contains(err.Error(), "transaction not found") {
fmt.Println("TX NOT FOUND in TxInfo")
// try again, hacking around comet's mempool inconsistency
time.Sleep(500 * time.Millisecond)
return d.clt.TxQuery(ctx, hash)
Expand Down
11 changes: 10 additions & 1 deletion test/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@ import (
"errors"
)

var ErrTxNotConfirmed = errors.New("transaction not confirmed")
var (
ErrTxNotConfirmed = errors.New("transaction not confirmed")

// ErrTxNotFound is returned if a requested transaction is just not found.
// Unfortunately this happens frequently for a very brief period after
// broadcast. The bug is of unknown cause, but it seems like cometbft since
// query-tx is asking cometbft and we use "sync" broadcast meaning it was
// accepted into mempool. If it were mined then we also would have found it.
ErrTxNotFound = errors.New("transaction NOT FOUND")
)
4 changes: 4 additions & 0 deletions test/driver/operator/cli_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"math/big"
"strings"

"github.com/kwilteam/kwil-db/cmd/common/display"
"github.com/kwilteam/kwil-db/core/types"
Expand Down Expand Up @@ -61,6 +62,9 @@ func (o *OperatorCLIDriver) TxSuccess(ctx context.Context, txHash []byte) error
var res respTxQuery
err := o.runCommand(ctx, &res, "utils", "query-tx", hex.EncodeToString(txHash))
if err != nil {
if strings.Contains(err.Error(), "code = -202, message = transaction not found") {
return driver.ErrTxNotFound // This is what we need to solve! See the docs on this error type.
}
return err
}

Expand Down
2 changes: 1 addition & 1 deletion test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/kwilteam/kwil-db v0.7.2
github.com/kwilteam/kwil-db/core v0.3.0
github.com/kwilteam/kwil-db/parse v0.3.0
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.9.1-0.20241001093137-16a09b708612
github.com/testcontainers/testcontainers-go v0.31.0
github.com/testcontainers/testcontainers-go/modules/compose v0.29.2-0.20240321072901-c83b93cb1eff
go.uber.org/zap v1.27.0
Expand Down
3 changes: 2 additions & 1 deletion test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.9.1-0.20241001093137-16a09b708612 h1:Rbt7CDy7JrdMBJgaiwJfb4rLFF8AiEO0G6XD+tMDZME=
github.com/stretchr/testify v1.9.1-0.20241001093137-16a09b708612/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4=
Expand Down
8 changes: 4 additions & 4 deletions test/specifications/deploy_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func DatabaseDeploySpecification(ctx context.Context, t *testing.T, deploy Datab
require.NoError(t, err, "failed to send deploy database tx")

// Then i expect success
expectTxSuccess(t, deploy, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, deploy, ctx, txHash, defaultTxQueryTimeout)

// And i expect database should exist
err = deploy.DatabaseExists(ctx, deploy.DBID(db.Name))
Expand All @@ -39,14 +39,14 @@ func DatabaseDeployInvalidSql1Specification(ctx context.Context, t *testing.T, d
require.NoError(t, err, "failed to send deploy database tx")

// Then i expect tx failure
expectTxFail(t, deploy, ctx, txHash, defaultTxQueryTimeout)()
expectTxFail(t, deploy, ctx, txHash, defaultTxQueryTimeout)

// deploy fixed schema
db2 := SchemaLoader.Load(t, schemaInvalidSqlSyntaxFixed)
txHash2, err := deploy.DeployDatabase(ctx, db2)
require.NoError(t, err, "failed to send deploy database tx")

expectTxSuccess(t, deploy, ctx, txHash2, defaultTxQueryTimeout)()
expectTxSuccess(t, deploy, ctx, txHash2, defaultTxQueryTimeout)

err = deploy.DatabaseExists(ctx, deploy.DBID(db.Name))
require.NoError(t, err)
Expand All @@ -62,7 +62,7 @@ func DatabaseDeployInvalidExtensionSpecification(ctx context.Context, t *testing
require.NoError(t, err, "failed to send deploy database tx")

// Then i expect tx failure
expectTxFail(t, deploy, ctx, txHash, defaultTxQueryTimeout)()
expectTxFail(t, deploy, ctx, txHash, defaultTxQueryTimeout)

// And i expect database should not exist
err = deploy.DatabaseExists(ctx, deploy.DBID(db.Name))
Expand Down
4 changes: 2 additions & 2 deletions test/specifications/drop_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func DatabaseDropSpecification(ctx context.Context, t *testing.T, drop DatabaseD
require.NoError(t, err, "failed to send drop database tx")

// Then i expect success
expectTxSuccess(t, drop, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, drop, ctx, txHash, defaultTxQueryTimeout)

// And i expect database should not exist
err = drop.DatabaseExists(ctx, drop.DBID(db.Name))
Expand All @@ -29,5 +29,5 @@ func DatabaseDropSpecification(ctx context.Context, t *testing.T, drop DatabaseD
require.NoError(t, err, "failed to send drop database tx")

// Then i expect tx failure
expectTxFail(t, drop, ctx, txHash, defaultTxQueryTimeout)()
expectTxFail(t, drop, ctx, txHash, defaultTxQueryTimeout)
}
6 changes: 3 additions & 3 deletions test/specifications/eth_deposits.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func DeployDbInsufficientFundsSpecification(ctx context.Context, t *testing.T, d
require.NoError(t, err, "failed to send deploy database tx")

// Then i expect failure
expectTxFail(t, deployer, ctx, txHash, defaultTxQueryTimeout)()
expectTxFail(t, deployer, ctx, txHash, defaultTxQueryTimeout)

time.Sleep(2 * time.Second) // ensure sync from other nodes

Expand Down Expand Up @@ -220,7 +220,7 @@ func FundValidatorSpecification(ctx context.Context, t *testing.T, sender Deploy
require.NoError(t, err, "failed to send transfer tx")

// I expect success
expectTxSuccess(t, sender, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, sender, ctx, txHash, defaultTxQueryTimeout)

time.Sleep(2 * time.Second) // it reports the old state very briefly, wait a sec

Expand Down Expand Up @@ -270,7 +270,7 @@ func DeployDbSuccessSpecification(ctx context.Context, t *testing.T, deployer De
require.NoError(t, err, "failed to send deploy database tx")

// Then i expect success
expectTxSuccess(t, deployer, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, deployer, ctx, txHash, defaultTxQueryTimeout)

time.Sleep(2 * time.Second) // ensure sync from other nodes

Expand Down
4 changes: 2 additions & 2 deletions test/specifications/execute_call_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func ExecuteCallPrivateModeSpecification(ctx context.Context, t *testing.T, auth
txHash, err := authCaller.Execute(ctx, dbID, createUserActionName, createUserActionInput)
assert.NoError(t, err)

expectTxSuccess(t, authCaller, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, authCaller, ctx, txHash, defaultTxQueryTimeout)

// testing query database: disabled for all clients
_, err = noAuthCaller.QueryDatabase(ctx, dbID, "SELECT * FROM users")
Expand All @@ -109,7 +109,7 @@ func ExecuteCallPrivateModeSpecification(ctx context.Context, t *testing.T, auth
txHash, err = authCaller.Execute(ctx, dbID, createPostQueryName, post1...)
assert.NoError(t, err)

expectTxSuccess(t, authCaller, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, authCaller, ctx, txHash, defaultTxQueryTimeout)

// testing call action
getPostInput := []any{1111}
Expand Down
2 changes: 1 addition & 1 deletion test/specifications/execute_delete_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func ExecuteDBDeleteSpecification(ctx context.Context, t *testing.T, execute Exe
txHash, err := execute.Execute(ctx, dbID, actionName, []any{user1Id})
assert.NoError(t, err)

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)

// check that user is deleted
res, err = execute.QueryDatabase(ctx, dbID, fmt.Sprintf("SELECT * FROM users WHERE id = %d", user1Id))
Expand Down
2 changes: 1 addition & 1 deletion test/specifications/execute_extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func ExecuteExtensionSpecification(ctx context.Context, t *testing.T, execute Ex
txHash, err := execute.Execute(ctx, dbID, divideActionName, []any{2, 1, 2})
assert.NoError(t, err)

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)

records, err := execute.Call(ctx, dbID, divideActionName, []any{2, 1, 2})
assert.NoError(t, err)
Expand Down
10 changes: 5 additions & 5 deletions test/specifications/execute_insert_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func ExecuteDBSingleInsertSpecification(ctx context.Context, t *testing.T, execu
txHash, err := execute.Execute(ctx, dbID, createUserActionName, createUserActionInput)
assert.NoError(t, err)

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)

// testing query database
records, err := execute.QueryDatabase(ctx, dbID, "SELECT * FROM users")
Expand All @@ -64,7 +64,7 @@ func ExecuteDBSingleInsertSpecification(ctx context.Context, t *testing.T, execu
txHash, err = execute.Execute(ctx, dbID, createPostQueryName, post1...)
assert.NoError(t, err)

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)

records, err = execute.QueryDatabase(ctx, dbID, "SELECT * FROM posts")
assert.NoError(t, err)
Expand All @@ -80,7 +80,7 @@ func ExecuteDBSingleInsertSpecification(ctx context.Context, t *testing.T, execu
//txHash, err = execute.Execute(ctx, dbID, multiStmtActionName, nil)
//assert.NoError(t, err)
//
//expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
//expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)
}

// ExecuteDBBatchInsertSpecification is a specification for database batch insert,
Expand All @@ -104,7 +104,7 @@ func ExecuteDBBatchInsertSpecification(ctx context.Context, t *testing.T, execut
txHash, err := execute.Execute(ctx, dbID, createUserActionName, createUserActionInput)
assert.NoError(t, err)

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)

// testing query database
records, err := execute.QueryDatabase(ctx, dbID, "SELECT * FROM users")
Expand All @@ -121,7 +121,7 @@ func ExecuteDBBatchInsertSpecification(ctx context.Context, t *testing.T, execut
txHash, err = execute.Execute(ctx, dbID, createPostQueryName, post1...)
assert.NoError(t, err)

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)

records, err = execute.QueryDatabase(ctx, dbID, "SELECT * FROM posts")
assert.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions test/specifications/execute_owner_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func ExecuteOwnerActionSpecification(ctx context.Context, t *testing.T, execute
txHash, err := execute.Execute(ctx, dbID, ownerOnlyActionName, actionInputs)
require.NoError(t, err, "error executing owner action")

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)
}

func ExecuteOwnerActionFailSpecification(ctx context.Context, t *testing.T, execute ExecuteActionsDsl, dbID string) {
Expand All @@ -32,7 +32,7 @@ func ExecuteOwnerActionFailSpecification(ctx context.Context, t *testing.T, exec
txHash, err := execute.Execute(ctx, dbID, ownerOnlyActionName, actionInputs)
require.NoError(t, err, "error executing owner action")

expectTxFail(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxFail(t, execute, ctx, txHash, defaultTxQueryTimeout)

// call authenticated, should fail
_, err = execute.Call(ctx, dbID, ownerOnlyActionName, actionInputs)
Expand Down
4 changes: 2 additions & 2 deletions test/specifications/execute_private_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func ExecutePrivateActionSpecification(ctx context.Context, t *testing.T, execut
txHash, err := execute.Execute(ctx, dbID, "create_post_private", createPostActionInput)
require.NoError(t, err, "error executing private action")

expectTxFail(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxFail(t, execute, ctx, txHash, defaultTxQueryTimeout)

if hasUser(ctx, t, execute, dbID, id) {
t.Fatalf("user %d should not exist", id)
Expand All @@ -33,7 +33,7 @@ func ExecutePrivateActionSpecification(ctx context.Context, t *testing.T, execut
txHash, err = execute.Execute(ctx, dbID, "create_post_nested", createPostActionInput)
require.NoError(t, err, "error executing nested action")

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)

if !hasUser(ctx, t, execute, dbID, id) {
t.Fatalf("user %d should exist", id)
Expand Down
2 changes: 1 addition & 1 deletion test/specifications/execute_update_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func ExecuteDBUpdateSpecification(ctx context.Context, t *testing.T, execute Exe
txHash, err := execute.Execute(ctx, dbID, actionName, actionInput...)
assert.NoError(t, err)

expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, execute, ctx, txHash, defaultTxQueryTimeout)

// Then i expect row to be updated
receipt, err := execute.QueryDatabase(ctx, dbID, "SELECT * FROM users WHERE id = 2222")
Expand Down
4 changes: 2 additions & 2 deletions test/specifications/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func SubmitMigrationProposal(ctx context.Context, t *testing.T, netops Migration
require.NoError(t, err)

// Ensure that the Tx is mined.
expectTxSuccess(t, netops, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, netops, ctx, txHash, defaultTxQueryTimeout)

// Check migration status
migrations, err := netops.ListMigrations(ctx)
Expand All @@ -46,7 +46,7 @@ func ApproveMigration(ctx context.Context, t *testing.T, netops MigrationOpsDsl,
require.NoError(t, err)

// Ensure that the Tx is mined.
expectTxSuccess(t, netops, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, netops, ctx, txHash, defaultTxQueryTimeout)

// Check migration status
migrations, err = netops.ListMigrations(ctx)
Expand Down
2 changes: 1 addition & 1 deletion test/specifications/notices.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func ExecuteNoticeSpecification(ctx context.Context, t *testing.T, caller Notice
require.NoError(t, err, "failed to send deploy database tx")

// Then i expect success
expectTxSuccess(t, caller, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, caller, ctx, txHash, defaultTxQueryTimeout)

// And i expect database should exist
err = caller.DatabaseExists(ctx, caller.DBID(db.Name))
Expand Down
6 changes: 3 additions & 3 deletions test/specifications/procedures.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func ExecuteProcedureSpecification(ctx context.Context, t *testing.T, caller Pro
txHash, err := caller.DeployDatabase(ctx, schema)
require.NoError(t, err, "error deploying schema")

expectTxSuccess(t, caller, ctx, txHash, defaultTxQueryTimeout)()
expectTxSuccess(t, caller, ctx, txHash, defaultTxQueryTimeout)

dbid := caller.DBID(schema.Name)

Expand Down Expand Up @@ -80,9 +80,9 @@ func (e *executor) Execute(ctx context.Context, actionName string, actionInputs
require.NoError(e.t, err, "error executing action")

if len(expectFail) > 0 && expectFail[0] {
expectTxFail(e.t, e.dsl, ctx, res, defaultTxQueryTimeout)()
expectTxFail(e.t, e.dsl, ctx, res, defaultTxQueryTimeout)
} else {
expectTxSuccess(e.t, e.dsl, ctx, res, defaultTxQueryTimeout)()
expectTxSuccess(e.t, e.dsl, ctx, res, defaultTxQueryTimeout)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/specifications/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func testUint256(ctx context.Context, t *testing.T, execute ProcedureDSL, dbid s
res, err = execute.Execute(ctx, dbid, callType+"_store_uint256s", []any{"115792089237316195423570985008687907853269984665640564039457584007913129639936", uint256Arr})
require.NoError(t, err)

ExpectTxfail(t, execute, ctx, res)
ExpectTxFail(t, execute, ctx, res)
}

func testText(ctx context.Context, t *testing.T, execute ProcedureDSL, dbid string, callType string) {
Expand Down
Loading
Loading