From e0cf3cd7b5f2d5850ce1325321ae863dbe0cd4f4 Mon Sep 17 00:00:00 2001 From: Pavel Zbitskiy Date: Wed, 12 Feb 2025 11:04:32 -0500 Subject: [PATCH 1/3] tests: fix flaky TestApplicationsUpgradeOverGossip --- test/e2e-go/upgrades/application_support_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e-go/upgrades/application_support_test.go b/test/e2e-go/upgrades/application_support_test.go index 7dffd5dc41..c2b1a2c8fd 100644 --- a/test/e2e-go/upgrades/application_support_test.go +++ b/test/e2e-go/upgrades/application_support_test.go @@ -344,9 +344,10 @@ func TestApplicationsUpgradeOverGossip(t *testing.T) { a.NoError(err) // Fund the manager, so it can issue transactions later on - _, err = client.SendPaymentFromUnencryptedWallet(creator, user, fee, 10000000000, nil) + tx0, err := client.SendPaymentFromUnencryptedWallet(creator, user, fee, 10000000000, nil) a.NoError(err) - client.WaitForRound(round + 2) + isCommitted := fixture.WaitForTxnConfirmation(round+10, tx0.ID().String()) + a.True(isCommitted) round, err = client.CurrentRound() a.NoError(err) @@ -454,7 +455,7 @@ int 1 // Try polling 10 rounds to ensure txn is committed. round, err = client.CurrentRound() a.NoError(err) - isCommitted := fixture.WaitForTxnConfirmation(round+10, txid) + isCommitted = fixture.WaitForTxnConfirmation(round+10, txid) a.True(isCommitted) // check creator's balance record for the app entry and the state changes From 2eb7a3d2d5c3d56fe949d62de5440f6f81213cb6 Mon Sep 17 00:00:00 2001 From: Pavel Zbitskiy Date: Wed, 12 Feb 2025 11:11:14 -0500 Subject: [PATCH 2/3] tests: store ledger files from newSimpleLedgerFull in temp dir --- ledger/simple_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ledger/simple_test.go b/ledger/simple_test.go index 6d8142f47b..0377a29d54 100644 --- a/ledger/simple_test.go +++ b/ledger/simple_test.go @@ -19,6 +19,7 @@ package ledger import ( "context" "fmt" + "path/filepath" "strings" "testing" @@ -74,8 +75,10 @@ func newSimpleLedgerFull(t testing.TB, balances bookkeeping.GenesisBalances, cv require.NoError(t, err) require.False(t, genBlock.FeeSink.IsZero()) require.False(t, genBlock.RewardsPool.IsZero()) + tempDir := t.TempDir() dbName := fmt.Sprintf("%s.%d", t.Name(), crypto.RandUint64()) dbName = strings.Replace(dbName, "/", "_", -1) + dbName = filepath.Join(tempDir, dbName) cfg.Archival = !slCfg.notArchival log := slCfg.logger if log == nil { From d8227cb1e0df413951bc2f07ba8fb671835ae30d Mon Sep 17 00:00:00 2001 From: Pavel Zbitskiy Date: Wed, 12 Feb 2025 12:22:33 -0500 Subject: [PATCH 3/3] tests: add short test opt to TestCatchpointAfterStakeLookupTxns --- ledger/catchpointfilewriter_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ledger/catchpointfilewriter_test.go b/ledger/catchpointfilewriter_test.go index 6413c741c4..fbed0ae3b8 100644 --- a/ledger/catchpointfilewriter_test.go +++ b/ledger/catchpointfilewriter_test.go @@ -1144,8 +1144,10 @@ func TestCatchpointAfterStakeLookupTxns(t *testing.T) { shortMax := max(config.Consensus[protocol.ConsensusFuture].MaxBalLookback, config.Consensus[protocol.ConsensusFuture].CatchpointLookback) shortRounds := 2*shortMax + 50 longRounds := uint64(1500) - t.Run("future", func(t *testing.T) { testCatchpointAfterStakeLookupTxns(t, protocol.ConsensusFuture, longRounds, true) }) - t.Run("future_noSP", func(t *testing.T) { testCatchpointAfterStakeLookupTxns(t, futureNoSP, longRounds, false) }) + if !testing.Short() { + t.Run("future", func(t *testing.T) { testCatchpointAfterStakeLookupTxns(t, protocol.ConsensusFuture, longRounds, true) }) + t.Run("future_noSP", func(t *testing.T) { testCatchpointAfterStakeLookupTxns(t, futureNoSP, longRounds, false) }) + } t.Run("future_short", func(t *testing.T) { testCatchpointAfterStakeLookupTxns(t, protocol.ConsensusFuture, shortRounds, true) }) t.Run("future_noSP_short", func(t *testing.T) { testCatchpointAfterStakeLookupTxns(t, futureNoSP, shortRounds, false) }) }