From 5d89697d6a258f661ad420514a844d557175d36b Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Thu, 11 Jul 2024 15:38:48 -0700 Subject: [PATCH] #4911: reset command args after each cmd invoke in db cmd tests --- services/horizon/internal/integration/db_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/horizon/internal/integration/db_test.go b/services/horizon/internal/integration/db_test.go index bed535a473..f5f9c0abe2 100644 --- a/services/horizon/internal/integration/db_test.go +++ b/services/horizon/internal/integration/db_test.go @@ -547,6 +547,7 @@ func TestReingestDB(t *testing.T) { "captive-core-reingest-range-integration-tests.cfg", ) + horizoncmd.ResetCommandArgs() horizoncmd.RootCmd.SetArgs(command(t, horizonConfig, "db", "reingest", "range", @@ -605,6 +606,7 @@ func TestReingestDatastore(t *testing.T) { t.Logf("fake gcs server started at %v", gcsServer.URL()) t.Setenv("STORAGE_EMULATOR_HOST", gcsServer.URL()) + horizoncmd.ResetCommandArgs() horizoncmd.RootCmd.SetArgs([]string{"db", "reingest", "range", @@ -689,7 +691,6 @@ func TestReingestDBWithFilterRules(t *testing.T) { itest, _ := initializeDBIntegrationTest(t) tt := assert.New(t) - horizoncmd.ResetCommandArgs() archive, err := historyarchive.Connect( itest.GetHorizonIngestConfig().HistoryArchiveURLs[0], historyarchive.ArchiveOptions{ @@ -785,6 +786,7 @@ func TestReingestDBWithFilterRules(t *testing.T) { itest.StopHorizon() // clear the db with reaping all ledgers + horizoncmd.ResetCommandArgs() horizoncmd.RootCmd.SetArgs(command(t, itest.GetHorizonIngestConfig(), "db", "reap", "--history-retention-count=1", @@ -793,6 +795,7 @@ func TestReingestDBWithFilterRules(t *testing.T) { // repopulate the db with reingestion which should catchup using core reapply filter rules // correctly on reingestion ranged + horizoncmd.ResetCommandArgs() horizoncmd.RootCmd.SetArgs(command(t, itest.GetHorizonIngestConfig(), "db", "reingest", "range",