From 50fffbfb1f61a1149dfad79955d934505404250b Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Fri, 22 Nov 2024 18:31:19 -0500 Subject: [PATCH] Fix test --- protocol/testutil/app/app.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/protocol/testutil/app/app.go b/protocol/testutil/app/app.go index a4dbac0bc2f..d4796971399 100644 --- a/protocol/testutil/app/app.go +++ b/protocol/testutil/app/app.go @@ -533,7 +533,11 @@ func (builder TestAppBuilder) Build() *TestApp { tApp.builder.t.Fatal(err) return nil } - app, shutdownFn, err := launchValidatorInDir(validatorHomeDir, filteredAppOptions) + app, shutdownFn, err := launchValidatorInDir( + validatorHomeDir, + filteredAppOptions, + "--optimistic-execution-enabled=false", + ) if err != nil { tApp.builder.t.Fatal(err) return nil @@ -559,7 +563,11 @@ func (builder TestAppBuilder) Build() *TestApp { tApp.crashingApp = nil if err == nil { - app, shutdownFn, doneOrRestartErr = launchValidatorInDir(validatorHomeDir, filteredAppOptions) + app, shutdownFn, doneOrRestartErr = launchValidatorInDir( + validatorHomeDir, + filteredAppOptions, + "--optimistic-execution-enabled=false", + ) } // If we errored shutting down or relaunching then update the shutdownFn to return this error @@ -1241,6 +1249,7 @@ func prepareValidatorHomeDir( func launchValidatorInDir( validatorHomeDir string, appOptions map[string]interface{}, + additionalCmdArgs ...string, ) (a *app.App, shutdownFn func() error, err error) { // Create a context that can be cancelled to stop the Cosmos App. done := make(chan error, 1) @@ -1289,7 +1298,7 @@ func launchValidatorInDir( // Specify the start-up flags. // TODO(CLOB-930): Allow for these flags to be overridden. - rootCmd.SetArgs([]string{ + cmdArgs := []string{ "start", // Do not start tendermint. "--grpc-only", @@ -1308,7 +1317,9 @@ func launchValidatorInDir( "--oracle.enabled=false", "--oracle.metrics_enabled=false", "--log_level=error", - }) + } + cmdArgs = append(cmdArgs, additionalCmdArgs...) + rootCmd.SetArgs(cmdArgs) ctx := svrcmd.CreateExecuteContext(parentCtx) rootCmd.PersistentFlags().String(