diff --git a/agreement/bundle_test.go b/agreement/bundle_test.go index b1b530aac0..0ab62dede6 100644 --- a/agreement/bundle_test.go +++ b/agreement/bundle_test.go @@ -29,12 +29,12 @@ import ( "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // Test Bundle Creation func TestBundleCreation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -71,7 +71,7 @@ func TestBundleCreation(t *testing.T) { // Test Bundle validation with Zero Votes func TestBundleCreationWithZeroVotes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) //ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() ledger, _, _, _ := readOnlyFixture100() @@ -110,7 +110,7 @@ func makeBundlePanicWrapper(t *testing.T, message string, proposal proposalValue //Test Bundle Creation with Validation for duplicate votes from same sender func TestBundleCreationWithVotesFromSameAddress(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture10() round := ledger.NextRound() @@ -175,7 +175,7 @@ func TestBundleCreationWithVotesFromSameAddress(t *testing.T) { //Test Bundle Creation with Validation func TestBundleCreationWithEquivocationVotes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture10() round := ledger.NextRound() @@ -285,7 +285,7 @@ func TestBundleCreationWithEquivocationVotes(t *testing.T) { //Test Bundle Creation with Validation func TestBundleCertificationWithEquivocationVotes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture10() round := ledger.NextRound() @@ -360,7 +360,7 @@ func certificatePanicWrapper(t *testing.T, message string, ub unauthenticatedBun // Test Bundle Creation with Equivocation Votes under Quorum func TestBundleCreationWithEquivocationVotesUnderQuorum(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() diff --git a/agreement/certificate_test.go b/agreement/certificate_test.go index 2ec12551b0..e8b10e810d 100644 --- a/agreement/certificate_test.go +++ b/agreement/certificate_test.go @@ -28,7 +28,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func makeCertTesting(digest crypto.Digest, votes []vote, equiVotes []equivocationVote) Certificate { @@ -43,7 +43,7 @@ func verifyBundleAgainstLedger(b unauthenticatedBundle, l Ledger, avv *AsyncVote } func TestCertificateGoodCertificateBasic(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -71,7 +71,7 @@ func TestCertificateGoodCertificateBasic(t *testing.T) { } func TestCertificateGoodCertificateEarlyBreak(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -99,7 +99,7 @@ func TestCertificateGoodCertificateEarlyBreak(t *testing.T) { } func TestCertificateFinalCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -127,7 +127,7 @@ func TestCertificateFinalCert(t *testing.T) { } func TestCertificateBadCertificateWithFakeDoubleVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -182,7 +182,7 @@ func TestCertificateBadCertificateWithFakeDoubleVote(t *testing.T) { } func TestCertificateDifferentBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -213,7 +213,7 @@ func TestCertificateDifferentBlock(t *testing.T) { } func TestCertificateNoCertStep(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -237,7 +237,7 @@ func TestCertificateNoCertStep(t *testing.T) { } func TestCertificateNotEnoughVotesToCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -271,7 +271,7 @@ func TestCertificateNotEnoughVotesToCert(t *testing.T) { } func TestCertificateCertWrongRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -302,7 +302,7 @@ func TestCertificateCertWrongRound(t *testing.T) { } func TestCertificateCertWithTooFewVotes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -332,7 +332,7 @@ func TestCertificateCertWithTooFewVotes(t *testing.T) { } func TestCertificateDupVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() diff --git a/agreement/cryptoRequestContext_test.go b/agreement/cryptoRequestContext_test.go index 0f138cfd30..bdd98b8fdd 100644 --- a/agreement/cryptoRequestContext_test.go +++ b/agreement/cryptoRequestContext_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func forEachTagDo(fn func(protocol.Tag)) { @@ -33,7 +33,7 @@ func forEachTagDo(fn func(protocol.Tag)) { } func TestCryptoRequestContextAddCancelRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -68,7 +68,7 @@ func TestCryptoRequestContextAddCancelRound(t *testing.T) { } func TestCryptoRequestContextAddCancelPeriod(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -104,7 +104,7 @@ func TestCryptoRequestContextAddCancelPeriod(t *testing.T) { } func TestCryptoRequestContextAddCancelProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -130,7 +130,7 @@ func TestCryptoRequestContextAddCancelProposal(t *testing.T) { } func TestCryptoRequestContextAddCancelPinnedProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -155,7 +155,7 @@ func TestCryptoRequestContextAddCancelPinnedProposal(t *testing.T) { } func TestCryptoRequestContextAddNoCancelPinnedProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -180,7 +180,7 @@ func TestCryptoRequestContextAddNoCancelPinnedProposal(t *testing.T) { } func TestCryptoRequestContextAddNoInterferencePinnedProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -205,7 +205,7 @@ func TestCryptoRequestContextAddNoInterferencePinnedProposal(t *testing.T) { } func TestCryptoRequestContextCleanupByRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -254,7 +254,7 @@ func TestCryptoRequestContextCleanupByRound(t *testing.T) { } func TestCryptoRequestContextCleanupByRoundPinnedCertify(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -317,7 +317,7 @@ func TestCryptoRequestContextCleanupByRoundPinnedCertify(t *testing.T) { } func TestCryptoRequestContextCleanupByPeriod(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) @@ -380,7 +380,7 @@ func TestCryptoRequestContextCleanupByPeriod(t *testing.T) { } func TestCryptoRequestContextCleanupByPeriodPinned(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pending := makePendingRequestsContext() rnd := round(10) diff --git a/agreement/cryptoVerifier_test.go b/agreement/cryptoVerifier_test.go index 98934ac742..bced9c9f70 100644 --- a/agreement/cryptoVerifier_test.go +++ b/agreement/cryptoVerifier_test.go @@ -34,7 +34,7 @@ import ( "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var _ = fmt.Printf @@ -137,7 +137,7 @@ func getSelectorCapacity(tag protocol.Tag) int { } func TestCryptoVerifierBuffers(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("Test is flaky") diff --git a/agreement/demux_test.go b/agreement/demux_test.go index f72f3cd6ec..f099d79f8b 100644 --- a/agreement/demux_test.go +++ b/agreement/demux_test.go @@ -32,7 +32,7 @@ import ( "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/timers" ) @@ -415,7 +415,7 @@ var demuxTestUsecases = []demuxTestUsecase{ } func TestDemuxNext(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dt := &demuxTester{T: t} dt.Test() diff --git a/agreement/encoding_test.go b/agreement/encoding_test.go index 0d387069d9..b59c633c85 100644 --- a/agreement/encoding_test.go +++ b/agreement/encoding_test.go @@ -22,11 +22,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEmptyEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var v vote require.Equal(t, 1, len(protocol.Encode(&v))) diff --git a/agreement/gossip/networkFull_test.go b/agreement/gossip/networkFull_test.go index 53b501512d..ce49b579ef 100644 --- a/agreement/gossip/networkFull_test.go +++ b/agreement/gossip/networkFull_test.go @@ -28,7 +28,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util" ) @@ -126,7 +126,7 @@ func shutdownNetwork(nets []*networkImpl, counters []*messageCounter) { } func TestNetworkImplFullStackLong(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() @@ -136,7 +136,7 @@ func TestNetworkImplFullStackLong(t *testing.T) { } func TestNetworkImplFullStackQuick(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if !testing.Short() { t.Skip() diff --git a/agreement/gossip/network_test.go b/agreement/gossip/network_test.go index 549fa56f9d..3bbf744ca6 100644 --- a/agreement/gossip/network_test.go +++ b/agreement/gossip/network_test.go @@ -32,7 +32,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type sentMessage struct { @@ -339,7 +339,7 @@ func spinNetworkImpl(domain *whiteholeDomain) (whiteholeNet *whiteholeNetwork, c } func TestNetworkImpl(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() diff --git a/agreement/msgp_gen_test.go b/agreement/msgp_gen_test.go index 27e0fdc8cb..5c1ef46f70 100644 --- a/agreement/msgp_gen_test.go +++ b/agreement/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalCertificate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Certificate{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalCertificate(t *testing.T) { } func TestRandomizedEncodingCertificate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Certificate{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalCertificate(b *testing.B) { } func TestMarshalUnmarshalbundle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := bundle{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalbundle(t *testing.T) { } func TestRandomizedEncodingbundle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &bundle{}) } @@ -139,7 +139,7 @@ func BenchmarkUnmarshalbundle(b *testing.B) { } func TestMarshalUnmarshalequivocationVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := equivocationVote{} bts := v.MarshalMsg(nil) @@ -161,7 +161,7 @@ func TestMarshalUnmarshalequivocationVote(t *testing.T) { } func TestRandomizedEncodingequivocationVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &equivocationVote{}) } @@ -202,7 +202,7 @@ func BenchmarkUnmarshalequivocationVote(b *testing.B) { } func TestMarshalUnmarshalequivocationVoteAuthenticator(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := equivocationVoteAuthenticator{} bts := v.MarshalMsg(nil) @@ -224,7 +224,7 @@ func TestMarshalUnmarshalequivocationVoteAuthenticator(t *testing.T) { } func TestRandomizedEncodingequivocationVoteAuthenticator(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &equivocationVoteAuthenticator{}) } @@ -265,7 +265,7 @@ func BenchmarkUnmarshalequivocationVoteAuthenticator(b *testing.B) { } func TestMarshalUnmarshalproposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := proposal{} bts := v.MarshalMsg(nil) @@ -287,7 +287,7 @@ func TestMarshalUnmarshalproposal(t *testing.T) { } func TestRandomizedEncodingproposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &proposal{}) } @@ -328,7 +328,7 @@ func BenchmarkUnmarshalproposal(b *testing.B) { } func TestMarshalUnmarshalproposalValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := proposalValue{} bts := v.MarshalMsg(nil) @@ -350,7 +350,7 @@ func TestMarshalUnmarshalproposalValue(t *testing.T) { } func TestRandomizedEncodingproposalValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &proposalValue{}) } @@ -391,7 +391,7 @@ func BenchmarkUnmarshalproposalValue(b *testing.B) { } func TestMarshalUnmarshalproposerSeed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := proposerSeed{} bts := v.MarshalMsg(nil) @@ -413,7 +413,7 @@ func TestMarshalUnmarshalproposerSeed(t *testing.T) { } func TestRandomizedEncodingproposerSeed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &proposerSeed{}) } @@ -454,7 +454,7 @@ func BenchmarkUnmarshalproposerSeed(b *testing.B) { } func TestMarshalUnmarshalrawVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := rawVote{} bts := v.MarshalMsg(nil) @@ -476,7 +476,7 @@ func TestMarshalUnmarshalrawVote(t *testing.T) { } func TestRandomizedEncodingrawVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &rawVote{}) } @@ -517,7 +517,7 @@ func BenchmarkUnmarshalrawVote(b *testing.B) { } func TestMarshalUnmarshalseedInput(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := seedInput{} bts := v.MarshalMsg(nil) @@ -539,7 +539,7 @@ func TestMarshalUnmarshalseedInput(t *testing.T) { } func TestRandomizedEncodingseedInput(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &seedInput{}) } @@ -580,7 +580,7 @@ func BenchmarkUnmarshalseedInput(b *testing.B) { } func TestMarshalUnmarshalselector(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := selector{} bts := v.MarshalMsg(nil) @@ -602,7 +602,7 @@ func TestMarshalUnmarshalselector(t *testing.T) { } func TestRandomizedEncodingselector(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &selector{}) } @@ -643,7 +643,7 @@ func BenchmarkUnmarshalselector(b *testing.B) { } func TestMarshalUnmarshaltransmittedPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := transmittedPayload{} bts := v.MarshalMsg(nil) @@ -665,7 +665,7 @@ func TestMarshalUnmarshaltransmittedPayload(t *testing.T) { } func TestRandomizedEncodingtransmittedPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &transmittedPayload{}) } @@ -706,7 +706,7 @@ func BenchmarkUnmarshaltransmittedPayload(b *testing.B) { } func TestMarshalUnmarshalunauthenticatedBundle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := unauthenticatedBundle{} bts := v.MarshalMsg(nil) @@ -728,7 +728,7 @@ func TestMarshalUnmarshalunauthenticatedBundle(t *testing.T) { } func TestRandomizedEncodingunauthenticatedBundle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &unauthenticatedBundle{}) } @@ -769,7 +769,7 @@ func BenchmarkUnmarshalunauthenticatedBundle(b *testing.B) { } func TestMarshalUnmarshalunauthenticatedEquivocationVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := unauthenticatedEquivocationVote{} bts := v.MarshalMsg(nil) @@ -791,7 +791,7 @@ func TestMarshalUnmarshalunauthenticatedEquivocationVote(t *testing.T) { } func TestRandomizedEncodingunauthenticatedEquivocationVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &unauthenticatedEquivocationVote{}) } @@ -832,7 +832,7 @@ func BenchmarkUnmarshalunauthenticatedEquivocationVote(b *testing.B) { } func TestMarshalUnmarshalunauthenticatedProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := unauthenticatedProposal{} bts := v.MarshalMsg(nil) @@ -854,7 +854,7 @@ func TestMarshalUnmarshalunauthenticatedProposal(t *testing.T) { } func TestRandomizedEncodingunauthenticatedProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &unauthenticatedProposal{}) } @@ -895,7 +895,7 @@ func BenchmarkUnmarshalunauthenticatedProposal(b *testing.B) { } func TestMarshalUnmarshalunauthenticatedVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := unauthenticatedVote{} bts := v.MarshalMsg(nil) @@ -917,7 +917,7 @@ func TestMarshalUnmarshalunauthenticatedVote(t *testing.T) { } func TestRandomizedEncodingunauthenticatedVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &unauthenticatedVote{}) } @@ -958,7 +958,7 @@ func BenchmarkUnmarshalunauthenticatedVote(b *testing.B) { } func TestMarshalUnmarshalvote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := vote{} bts := v.MarshalMsg(nil) @@ -980,7 +980,7 @@ func TestMarshalUnmarshalvote(t *testing.T) { } func TestRandomizedEncodingvote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &vote{}) } @@ -1021,7 +1021,7 @@ func BenchmarkUnmarshalvote(b *testing.B) { } func TestMarshalUnmarshalvoteAuthenticator(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := voteAuthenticator{} bts := v.MarshalMsg(nil) @@ -1043,7 +1043,7 @@ func TestMarshalUnmarshalvoteAuthenticator(t *testing.T) { } func TestRandomizedEncodingvoteAuthenticator(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &voteAuthenticator{}) } diff --git a/agreement/persistence_test.go b/agreement/persistence_test.go index 7478cea69d..5c1bfda60d 100644 --- a/agreement/persistence_test.go +++ b/agreement/persistence_test.go @@ -26,13 +26,13 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" "github.com/algorand/go-algorand/util/timers" ) func TestAgreementSerialization(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // todo : we need to deserialize some more meaningfull state. clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC)) @@ -85,7 +85,7 @@ func BenchmarkAgreementDeserialization(b *testing.B) { } func TestAgreementPersistence(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) accessor, err := db.MakeAccessor(t.Name()+"_crash.db", false, true) require.NoError(t, err) diff --git a/agreement/player_permutation_test.go b/agreement/player_permutation_test.go index 3a3aeeb501..2b832c63b0 100644 --- a/agreement/player_permutation_test.go +++ b/agreement/player_permutation_test.go @@ -27,7 +27,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func makeRandomProposalPayload(r round) *proposal { @@ -745,7 +745,7 @@ func verifyPermutationExpectedActions(t *testing.T, playerN int, eventN int, hel // Generates a set of player states, router states, and messageEvents and tests all permutations of them func TestPlayerPermutation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for i := 0; i < 7; i++ { for j := 0; j < 14; j++ { diff --git a/agreement/player_test.go b/agreement/player_test.go index d1eabdb30c..0719864c7c 100644 --- a/agreement/player_test.go +++ b/agreement/player_test.go @@ -26,7 +26,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var playerTracer tracer @@ -426,7 +426,7 @@ func testPlayerSetup() (player, rootRouter, testAccountData, testBlockFactory, L } func TestPlayerSynchronous(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, router, accs, f, ledger := testPlayerSetup() @@ -436,7 +436,7 @@ func TestPlayerSynchronous(t *testing.T) { } func TestPlayerOffsetStart(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, router, accs, f, ledger := testPlayerSetup() @@ -456,7 +456,7 @@ func TestPlayerOffsetStart(t *testing.T) { } func TestPlayerLateBlockProposalPeriod0(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, router, accs, f, ledger := testPlayerSetup() @@ -511,7 +511,7 @@ func setupP(t *testing.T, r round, p period, s step) (plyr *player, pMachine ioA // ISV = Issue Soft Vote func TestPlayerISVDoesNotSoftVoteBottom(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // every soft vote is associated with a proposalValue != bottom. const r = round(209) @@ -537,7 +537,7 @@ func TestPlayerISVDoesNotSoftVoteBottom(t *testing.T) { } func TestPlayerISVVoteForStartingValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if we see a next value quorum, and no next bottom quorum, vote for that value regardless // every soft vote is associated with a proposalValue != bottom. @@ -582,7 +582,7 @@ func TestPlayerISVVoteForStartingValue(t *testing.T) { } func TestPlayerISVVoteNoVoteSansProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if we see no proposal, even if we see a next-value bottom quorum, do not issue a soft vote @@ -635,7 +635,7 @@ func TestPlayerISVVoteNoVoteSansProposal(t *testing.T) { } func TestPlayerISVVoteForReProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // even if we saw bottom, if we see reproposal, and a next value quorum, vote for it // why do reproposals need to be associated with next value quorums? (instead of just a next @@ -724,7 +724,7 @@ func TestPlayerISVVoteForReProposal(t *testing.T) { } func TestPlayerISVNoVoteForUnsupportedReProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if there's no next value quorum, don't support the reproposal const r = round(209) @@ -784,7 +784,7 @@ func TestPlayerISVNoVoteForUnsupportedReProposal(t *testing.T) { // ICV = Issue Cert Vote func TestPlayerICVOnSoftThresholdSamePeriod(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // basic cert vote check. // This also tests cert vote even if freeze timer has not yet fired @@ -858,7 +858,7 @@ func TestPlayerICVOnSoftThresholdSamePeriod(t *testing.T) { } func TestPlayerICVOnSoftThresholdPrePayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Check cert voting when soft bundle is received // before a proposal payload. Should still generate cert vote. @@ -930,7 +930,7 @@ func TestPlayerICVOnSoftThresholdPrePayload(t *testing.T) { } func TestPlayerICVOnSoftThresholdThenPayloadNoProposalVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if there's no proposal vote, a soft threshold should still trigger a cert vote const r = round(12) @@ -984,7 +984,7 @@ func TestPlayerICVOnSoftThresholdThenPayloadNoProposalVote(t *testing.T) { } func TestPlayerICVNoVoteForUncommittableProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(12) const p = period(1) @@ -1041,7 +1041,7 @@ func TestPlayerICVNoVoteForUncommittableProposal(t *testing.T) { } func TestPlayerICVPanicOnSoftBottomThreshold(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(209) const p = period(1) @@ -1075,7 +1075,7 @@ func TestPlayerICVPanicOnSoftBottomThreshold(t *testing.T) { // FF = Fast Forwarding func TestPlayerFFSoftThreshold(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // future periods const r = round(201221) @@ -1115,7 +1115,7 @@ func TestPlayerFFSoftThreshold(t *testing.T) { } func TestPlayerFFSoftThresholdWithPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // future periods // must also cert vote @@ -1188,7 +1188,7 @@ func TestPlayerFFSoftThresholdWithPayload(t *testing.T) { } func TestPlayerFFSoftThresholdLatePayloadCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // should cert vote after fast forwarding due to soft bundle, if we see late payload const r = round(201221) @@ -1260,7 +1260,7 @@ func TestPlayerFFSoftThresholdLatePayloadCert(t *testing.T) { } func TestPlayerFFNextThresholdBottom(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine starting at period 0 const r = round(209) @@ -1296,7 +1296,7 @@ func TestPlayerFFNextThresholdBottom(t *testing.T) { } func TestPlayerFFNextThresholdValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine starting at period 0 const r = round(209) @@ -1332,7 +1332,7 @@ func TestPlayerFFNextThresholdValue(t *testing.T) { } func TestPlayerDoesNotFastForwardOldThresholdEvents(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // thresholds/bundles with p_k < p are useless and should not cause any logic // (though, in the process of generating the threshold, it should update cached next bundle) @@ -1421,7 +1421,7 @@ func TestPlayerDoesNotFastForwardOldThresholdEvents(t *testing.T) { // Proposals // Contract: player should not propose unless it sees valid proof of proposal safety func TestPlayerProposesBottomBundle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // sanity check that player actually proposes something // player should create a new proposal @@ -1461,7 +1461,7 @@ func TestPlayerProposesBottomBundle(t *testing.T) { } func TestPlayerProposesNewRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // player should create a new proposal on new round const r = round(209) @@ -1525,7 +1525,7 @@ func TestPlayerProposesNewRound(t *testing.T) { } func TestPlayerCertificateThenPayloadEntersNewRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // player should create a new proposal on new round const r = round(209) @@ -1580,7 +1580,7 @@ func TestPlayerCertificateThenPayloadEntersNewRound(t *testing.T) { } func TestPlayerReproposesNextValueBundleWithoutPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Even having not seen the payload, player should still repropose const r = round(209) @@ -1624,7 +1624,7 @@ func TestPlayerReproposesNextValueBundleWithoutPayload(t *testing.T) { } func TestPlayerReproposesNextValueBundleRelaysPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // player should forward the proposal payload, forwad freshest bundle, and broadcast a reproposal vote. // which comes from the previous period. (has period set to p - 1) @@ -1725,7 +1725,7 @@ func TestPlayerReproposesNextValueBundleRelaysPayload(t *testing.T) { // Commitment func TestPlayerCommitsCertThreshold(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(20239) const p = period(1001) @@ -1793,7 +1793,7 @@ const testPartitionPeriod = 3 var testPartitionStep = partitionStep func TestPlayerRePropagatesFreshestBundle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // let's just fire a bunch of timeouts const r = round(20239) @@ -1856,7 +1856,7 @@ func TestPlayerRePropagatesFreshestBundle(t *testing.T) { } func TestPlayerPropagatesProposalPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if a player receives a payload from the network, it should relay it. const r = round(209) @@ -1893,7 +1893,7 @@ func TestPlayerPropagatesProposalPayload(t *testing.T) { } func TestPlayerPropagatesOwnProposalPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if a player receives a PayloadVerified event with its own payload, it should relay it. const r = round(209) @@ -1930,7 +1930,7 @@ func TestPlayerPropagatesOwnProposalPayload(t *testing.T) { } func TestPlayerPropagatesProposalPayloadFutureRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if a player receives a proposal payload for a future round, it should still // propagate it at some point. @@ -1976,7 +1976,7 @@ func TestPlayerPropagatesProposalPayloadFutureRound(t *testing.T) { } func TestPlayerRePropagatesProposalPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if player broadcasts a non-bottom freshest bundle during recovery/resynch, broadcast the // associated proposal payload. note this is distinct from relaying the payload @@ -2164,7 +2164,7 @@ func TestPlayerRePropagatesProposalPayload(t *testing.T) { } func TestPlayerPropagatesProposalVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(209) _, pM, helper := setupP(t, r, 0, soft) @@ -2188,7 +2188,7 @@ func TestPlayerPropagatesProposalVote(t *testing.T) { } func TestPlayerPropagatesSoftVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(209) _, pM, helper := setupP(t, r, 0, soft) @@ -2212,7 +2212,7 @@ func TestPlayerPropagatesSoftVote(t *testing.T) { } func TestPlayerPropagatesCertVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(209) _, pM, helper := setupP(t, r, 0, cert) @@ -2238,7 +2238,7 @@ func TestPlayerPropagatesCertVote(t *testing.T) { // Malformed Messages // check both proposals, proposal payloads, and votes, bundles func TestPlayerDisconnectsFromMalformedProposalVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(201221) const p = period(0) @@ -2277,7 +2277,7 @@ func TestPlayerDisconnectsFromMalformedProposalVote(t *testing.T) { } func TestPlayerIgnoresMalformedPayload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(201221) const p = period(0) @@ -2316,7 +2316,7 @@ func TestPlayerIgnoresMalformedPayload(t *testing.T) { } func TestPlayerDisconnectsFromMalformedVotes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(201221) const p = period(0) @@ -2356,7 +2356,7 @@ func TestPlayerDisconnectsFromMalformedVotes(t *testing.T) { } func TestPlayerDisconnectsFromMalformedBundles(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(201221) const p = period(0) @@ -2396,7 +2396,7 @@ func TestPlayerDisconnectsFromMalformedBundles(t *testing.T) { // Helper Sanity Checks func TestPlayerRequestsVoteVerification(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(201221) const p = period(0) @@ -2419,7 +2419,7 @@ func TestPlayerRequestsVoteVerification(t *testing.T) { } func TestPlayerRequestsProposalVoteVerification(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(1) const p = period(0) @@ -2442,7 +2442,7 @@ func TestPlayerRequestsProposalVoteVerification(t *testing.T) { } func TestPlayerRequestsBundleVerification(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(201221) const p = period(0) @@ -2467,7 +2467,7 @@ func TestPlayerRequestsBundleVerification(t *testing.T) { // Payload Pipelining func TestPlayerRequestsPayloadVerification(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(201221) const p = period(0) @@ -2504,7 +2504,7 @@ func TestPlayerRequestsPayloadVerification(t *testing.T) { } func TestPlayerRequestsPipelinedPayloadVerification(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(201221) const p = period(0) @@ -2599,7 +2599,7 @@ func TestPlayerRequestsPipelinedPayloadVerification(t *testing.T) { // Round pipelining func TestPlayerHandlesPipelinedThresholds(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // make sure we stage a pipelined soft threshold after entering new round const r = round(20) @@ -2713,7 +2713,7 @@ func TestPlayerHandlesPipelinedThresholds(t *testing.T) { } func TestPlayerRegression_EnsuresCertThreshFromOldPeriod_8ba23942(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // should not ignore cert thresholds from previous period in same round, if it // was saved as freshest threshold @@ -2789,7 +2789,7 @@ func TestPlayerRegression_EnsuresCertThreshFromOldPeriod_8ba23942(t *testing.T) } func TestPlayer_RejectsCertThresholdFromPreviousRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(20) const p = period(0) @@ -2824,7 +2824,7 @@ func TestPlayer_RejectsCertThresholdFromPreviousRound(t *testing.T) { } func TestPlayer_CommitsCertThresholdWithoutPreStaging(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if player has pinned a block, then sees a cert threshold, it should commit const r = round(20) @@ -2900,7 +2900,7 @@ func TestPlayer_CommitsCertThresholdWithoutPreStaging(t *testing.T) { } func TestPlayer_CertThresholdDoesNotBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // check that ledger gets a hint to stage digest const r = round(20) @@ -2936,7 +2936,7 @@ func TestPlayer_CertThresholdDoesNotBlock(t *testing.T) { } func TestPlayer_CertThresholdDoesNotBlockFuturePeriod(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // check that ledger gets a hint to stage digest const r = round(20) @@ -2972,7 +2972,7 @@ func TestPlayer_CertThresholdDoesNotBlockFuturePeriod(t *testing.T) { } func TestPlayer_CertThresholdFastForwards(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(20) const p = period(0) @@ -3012,7 +3012,7 @@ func TestPlayer_CertThresholdFastForwards(t *testing.T) { } func TestPlayer_CertThresholdCommitsFuturePeriodIfAlreadyHasBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(20) const p = period(0) @@ -3077,7 +3077,7 @@ func TestPlayer_CertThresholdCommitsFuturePeriodIfAlreadyHasBlock(t *testing.T) } func TestPlayer_PayloadAfterCertThresholdCommits(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = round(20) const p = period(0) @@ -3135,7 +3135,7 @@ func TestPlayer_PayloadAfterCertThresholdCommits(t *testing.T) { } func TestPlayerAlwaysResynchsPinnedValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // a white box test that checks the pinned value is relayed even it is not staged in the period corresponding to the freshest bundle const r = round(209) diff --git a/agreement/proposalManager_test.go b/agreement/proposalManager_test.go index 613e5775f0..24bdb9d0dd 100644 --- a/agreement/proposalManager_test.go +++ b/agreement/proposalManager_test.go @@ -19,7 +19,7 @@ package agreement import ( "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -43,7 +43,7 @@ func setupManager(t *testing.T, r round) (pWhite *proposalManager, pMachine ioAu } func TestProposalManagerThresholdSoftFastForward(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // sanity check that manager tells underlings to fast forward new period const p = 1 @@ -72,7 +72,7 @@ func TestProposalManagerThresholdSoftFastForward(t *testing.T) { } func TestProposalManagerThresholdSoftStage(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // sanity check that manager tells underlings to deal with soft threshold const p = 1 @@ -110,7 +110,7 @@ func TestProposalManagerThresholdSoftStage(t *testing.T) { } func TestProposalManagerThresholdCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const p = 10 const r = 1 @@ -147,7 +147,7 @@ func TestProposalManagerThresholdCert(t *testing.T) { } func TestProposalManagerThresholdNext(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // check that manager tells the Tracker to increase period +1 const p = 10 @@ -176,7 +176,7 @@ func TestProposalManagerThresholdNext(t *testing.T) { } func TestProposalManagerResetsRoundInterruption(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // check that manager tells Store to increase round + 1 const p = 10 @@ -194,7 +194,7 @@ func TestProposalManagerResetsRoundInterruption(t *testing.T) { } func TestProposalManagerRejectsUnknownEvent(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // check that manager discards unknown events. _, pM, _ := setupManager(t, 0) @@ -210,7 +210,7 @@ func TestProposalManagerRejectsUnknownEvent(t *testing.T) { } func TestProposalFreshAdjacentPeriods(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // votes from periods that are non-adjacent to current period are not fresh // unfortunately, this is more of an end-to-end test as the proposeTracker will also filter @@ -329,7 +329,7 @@ func TestProposalFreshAdjacentPeriods(t *testing.T) { } func TestProposalFreshAdjacentPeriodsVerified(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // verbatim copy of above test case, but with verified votes // votes from periods that are non-adjacent to current period are not fresh @@ -456,7 +456,7 @@ func TestProposalFreshAdjacentPeriodsVerified(t *testing.T) { } func TestProposalManagerCancelledVoteFiltered(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const r = 100000 const p = 2 diff --git a/agreement/proposalStore_test.go b/agreement/proposalStore_test.go index 87e6782141..93f2d15b41 100644 --- a/agreement/proposalStore_test.go +++ b/agreement/proposalStore_test.go @@ -28,7 +28,7 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var proposalStoreTracer tracer @@ -38,7 +38,7 @@ func init() { } func TestProposalStoreCreation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, router, accounts, factory, ledger := testSetup(0) @@ -48,7 +48,7 @@ func TestProposalStoreCreation(t *testing.T) { } func TestBlockAssemblerPipeline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type fields struct { Pipeline unauthenticatedProposal @@ -118,7 +118,7 @@ func TestBlockAssemblerPipeline(t *testing.T) { } func TestBlockAssemblerBind(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type fields struct { Pipeline unauthenticatedProposal @@ -186,7 +186,7 @@ func TestBlockAssemblerBind(t *testing.T) { } func TestBlockAssemblerAuthenticator(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type fields struct { Pipeline unauthenticatedProposal @@ -252,7 +252,7 @@ func TestBlockAssemblerAuthenticator(t *testing.T) { } func TestBlockAssemblerTrim(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type fields struct { Pipeline unauthenticatedProposal @@ -336,7 +336,7 @@ func TestBlockAssemblerTrim(t *testing.T) { } func TestProposalStoreT(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, _, accounts, factory, ledger := testSetup(0) @@ -404,7 +404,7 @@ func TestProposalStoreT(t *testing.T) { } func TestProposalStoreUnderlying(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type fields struct { Relevant map[period]proposalValue @@ -472,7 +472,7 @@ func TestProposalStoreUnderlying(t *testing.T) { } func TestProposalStoreHandle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, router, accounts, factory, ledger := testPlayerSetup() @@ -658,7 +658,7 @@ func TestProposalStoreHandle(t *testing.T) { } func TestProposalStoreGetPinnedValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // create proposal Store player, router, accounts, factory, ledger := testPlayerSetup() @@ -712,7 +712,7 @@ func TestProposalStoreGetPinnedValue(t *testing.T) { } func TestProposalStoreRegressionBlockRedeliveryBug_b29ea57(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var msgV1, msgV2, msgP1, msgP2 message var rv rawVote @@ -823,7 +823,7 @@ func TestProposalStoreRegressionBlockRedeliveryBug_b29ea57(t *testing.T) { } func TestProposalStoreRegressionWrongPipelinePeriodBug_39387501(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var msgV1, msgV2, msgP1, msgP2 message var rv rawVote diff --git a/agreement/proposalTracker_test.go b/agreement/proposalTracker_test.go index 8685a3aa06..7777ed14bf 100644 --- a/agreement/proposalTracker_test.go +++ b/agreement/proposalTracker_test.go @@ -21,7 +21,7 @@ import ( "sort" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -52,7 +52,7 @@ func sortedVoteGen(t *testing.T) (votes []vote) { } func TestProposalTrackerProposalSeeker(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) votes := sortedVoteGen(t) for len(votes) < 4 { @@ -327,7 +327,7 @@ func setupProposalTrackerTests(t *testing.T) (votes []vote) { } func TestProposalTrackerBasic(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) votes := setupProposalTrackerTests(t) for len(votes) <= 3 { diff --git a/agreement/proposal_test.go b/agreement/proposal_test.go index 1bfca5d4a4..49481ae84d 100644 --- a/agreement/proposal_test.go +++ b/agreement/proposal_test.go @@ -28,7 +28,7 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func testSetup(periodCount uint64) (player, rootRouter, testAccountData, testBlockFactory, Ledger) { @@ -108,7 +108,7 @@ func createProposalEvents(t *testing.T, player player, accs testAccountData, f t } func TestProposalCreation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, router, accounts, factory, ledger := testSetup(0) @@ -118,7 +118,7 @@ func TestProposalCreation(t *testing.T) { } func TestProposalFunctions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, _, accs, factory, ledger := testSetup(0) round := player.Round @@ -157,7 +157,7 @@ func TestProposalFunctions(t *testing.T) { } func TestProposalUnauthenticated(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) player, _, accounts, factory, ledger := testSetup(0) diff --git a/agreement/pseudonode_test.go b/agreement/pseudonode_test.go index 8e13243817..72f1a427c7 100644 --- a/agreement/pseudonode_test.go +++ b/agreement/pseudonode_test.go @@ -29,7 +29,7 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // The serializedPseudonode is the trivial implementation for the pseudonode interface @@ -133,7 +133,7 @@ func compareEventChannels(t *testing.T, ch1, ch2 <-chan externalEvent) bool { } func TestPseudonode(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -391,7 +391,7 @@ func (k *KeyManagerProxy) VotingKeys(votingRound, balanceRound basics.Round) []a } func TestPseudonodeLoadingOfParticipationKeys(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() diff --git a/agreement/service_test.go b/agreement/service_test.go index b03eebaadf..b0469237f5 100644 --- a/agreement/service_test.go +++ b/agreement/service_test.go @@ -39,7 +39,7 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" "github.com/algorand/go-algorand/util/timers" ) @@ -909,7 +909,7 @@ func simulateAgreementWithLedgerFactory(t *testing.T, numNodes int, numRounds in } func TestAgreementSynchronous1(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if testing.Short() { // t.Skip("Skipping agreement integration test") @@ -919,7 +919,7 @@ func TestAgreementSynchronous1(t *testing.T) { } func TestAgreementSynchronous2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if testing.Short() { // t.Skip("Skipping agreement integration test") @@ -929,7 +929,7 @@ func TestAgreementSynchronous2(t *testing.T) { } func TestAgreementSynchronous3(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // if testing.Short() { // t.Skip("Skipping agreement integration test") @@ -939,7 +939,7 @@ func TestAgreementSynchronous3(t *testing.T) { } func TestAgreementSynchronous4(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip("Skipping agreement integration test") @@ -949,7 +949,7 @@ func TestAgreementSynchronous4(t *testing.T) { } func TestAgreementSynchronous5(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip("Skipping agreement integration test") @@ -959,7 +959,7 @@ func TestAgreementSynchronous5(t *testing.T) { } func TestAgreementSynchronous10(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("Skipping flaky agreement integration test") if testing.Short() { t.Skip("Skipping agreement integration test") @@ -969,7 +969,7 @@ func TestAgreementSynchronous10(t *testing.T) { } func TestAgreementSynchronous5_50(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip("Skipping agreement integration test") @@ -979,7 +979,7 @@ func TestAgreementSynchronous5_50(t *testing.T) { } func TestAgreementSynchronousFuture1(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) //if testing.Short() { // t.Skip("Skipping agreement integration test") @@ -992,7 +992,7 @@ func TestAgreementSynchronousFuture1(t *testing.T) { } func TestAgreementSynchronousFuture5(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip("Skipping agreement integration test") @@ -1005,7 +1005,7 @@ func TestAgreementSynchronousFuture5(t *testing.T) { } func TestAgreementSynchronousFutureUpgrade(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip("Skipping agreement integration test") @@ -1021,7 +1021,7 @@ func TestAgreementSynchronousFutureUpgrade(t *testing.T) { } func TestAgreementFastRecoveryDownEarly(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1079,7 +1079,7 @@ func TestAgreementFastRecoveryDownEarly(t *testing.T) { } func TestAgreementFastRecoveryDownMiss(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1160,7 +1160,7 @@ func TestAgreementFastRecoveryDownMiss(t *testing.T) { } func TestAgreementFastRecoveryLate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1273,7 +1273,7 @@ func TestAgreementFastRecoveryLate(t *testing.T) { } func TestAgreementFastRecoveryRedo(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1427,7 +1427,7 @@ func TestAgreementFastRecoveryRedo(t *testing.T) { } func TestAgreementBlockReplayBug_b29ea57(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 2 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1486,7 +1486,7 @@ func TestAgreementBlockReplayBug_b29ea57(t *testing.T) { } func TestAgreementLateCertBug(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1544,7 +1544,7 @@ func TestAgreementLateCertBug(t *testing.T) { } func TestAgreementRecoverGlobalStartingValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1644,7 +1644,7 @@ func TestAgreementRecoverGlobalStartingValue(t *testing.T) { } func TestAgreementRecoverGlobalStartingValueBadProposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1747,7 +1747,7 @@ func TestAgreementRecoverGlobalStartingValueBadProposal(t *testing.T) { } func TestAgreementRecoverBothVAndBotQuorums(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1872,7 +1872,7 @@ func TestAgreementRecoverBothVAndBotQuorums(t *testing.T) { } func TestAgreementSlowPayloadsPreDeadline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1930,7 +1930,7 @@ func TestAgreementSlowPayloadsPreDeadline(t *testing.T) { } func TestAgreementSlowPayloadsPostDeadline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -1995,7 +1995,7 @@ func TestAgreementSlowPayloadsPostDeadline(t *testing.T) { } func TestAgreementLargePeriods(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 baseNetwork, baseLedger, cleanupFn, services, clocks, ledgers, activityMonitor := setupAgreement(t, numNodes, disabled, makeTestLedger) @@ -2092,7 +2092,7 @@ func (v *testSuspendableBlockValidator) suspend() chan struct{} { } func TestAgreementRegression_WrongPeriodPayloadVerificationCancellation_8ba23942(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 validator := makeTestSuspendableBlockValidator() @@ -2249,7 +2249,7 @@ func TestAgreementRegression_WrongPeriodPayloadVerificationCancellation_8ba23942 // (such as blocks and pipelined messages for the next round) // Note that the stall will be resolved by catchup even if the relay blocks. func TestAgreementCertificateDoesNotStallSingleRelay(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numNodes := 5 // single relay, four leaf nodes relayID := nodeID(0) @@ -2364,7 +2364,7 @@ func TestAgreementCertificateDoesNotStallSingleRelay(t *testing.T) { } func TestAgreementServiceStartDeadline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) accessor, err := db.MakeAccessor(t.Name()+"_crash.db", false, true) require.NoError(t, err) diff --git a/agreement/voteAggregator_test.go b/agreement/voteAggregator_test.go index 1e068d8504..8ab4aeb9d1 100644 --- a/agreement/voteAggregator_test.go +++ b/agreement/voteAggregator_test.go @@ -27,7 +27,7 @@ import ( "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var voteAggregatorTracer tracer @@ -37,7 +37,7 @@ func init() { } func TestVoteAggregatorVotes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -86,7 +86,7 @@ func TestVoteAggregatorVotes(t *testing.T) { } func TestVoteAggregatorBundles(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -155,7 +155,7 @@ func TestVoteAggregatorBundles(t *testing.T) { */ func TestVoteAggregatorFiltersVotePresentStale(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine rRouter := new(rootRouter) @@ -241,7 +241,7 @@ func TestVoteAggregatorFiltersVotePresentStale(t *testing.T) { } func TestVoteAggregatorFiltersVoteVerifiedStale(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine rRouter := new(rootRouter) @@ -318,7 +318,7 @@ func TestVoteAggregatorFiltersVoteVerifiedStale(t *testing.T) { } func TestVoteAggregatorFiltersVoteVerifiedThreshold(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine rRouter := new(rootRouter) @@ -375,7 +375,7 @@ func TestVoteAggregatorFiltersVoteVerifiedThreshold(t *testing.T) { } func TestVoteAggregatorFiltersBundlePresent(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine rRouter := new(rootRouter) @@ -479,7 +479,7 @@ func TestVoteAggregatorFiltersBundlePresent(t *testing.T) { } func TestVoteAggregatorFiltersBundleVerifiedThresholdStale(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine rRouter := new(rootRouter) @@ -597,7 +597,7 @@ func TestVoteAggregatorFiltersBundleVerifiedThresholdStale(t *testing.T) { } func TestVoteAggregatorFiltersBundleVerifiedRelayStale(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine rRouter := new(rootRouter) @@ -711,7 +711,7 @@ func TestVoteAggregatorFiltersBundleVerifiedRelayStale(t *testing.T) { } func TestVoteAggregatorFiltersVotePresentPeriod(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine rRouter := new(rootRouter) @@ -798,7 +798,7 @@ func TestVoteAggregatorFiltersVotePresentPeriod(t *testing.T) { } func TestVoteAggregatorFiltersVoteNextRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Set up a composed test machine rRouter := new(rootRouter) @@ -862,7 +862,7 @@ func TestVoteAggregatorFiltersVoteNextRound(t *testing.T) { } func TestVoteAggregatorOldVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cparams := config.Consensus[protocol.ConsensusCurrentVersion] maxNumBlocks := 2 * cparams.SeedRefreshInterval * cparams.SeedLookback diff --git a/agreement/voteAuxiliary_test.go b/agreement/voteAuxiliary_test.go index cb65a6e68f..4528c86438 100644 --- a/agreement/voteAuxiliary_test.go +++ b/agreement/voteAuxiliary_test.go @@ -23,7 +23,7 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // this helper object creates threshold events @@ -66,7 +66,7 @@ func makeVoteTrackerRoundZero() listener { } func TestVoteTrackerPeriodStepCachedThresholdPrivate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // goal: generate a next vote bottom quorum for the given period // check that Cached is set properly. This is a private @@ -133,7 +133,7 @@ func TestVoteTrackerPeriodStepCachedThresholdPrivate(t *testing.T) { // add value threshold only, make sure its returned in status func TestVoteTrackerPeriodValueStatus(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := nextThresholdHelper{} b := testCaseBuilder{} @@ -154,7 +154,7 @@ func TestVoteTrackerPeriodValueStatus(t *testing.T) { // check seen no thresholds func TestVoteTrackerPeriodNoneSeen(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) b := testCaseBuilder{} expectedStatus := nextThresholdStatusEvent{Bottom: false, Proposal: bottom} @@ -170,7 +170,7 @@ func TestVoteTrackerPeriodNoneSeen(t *testing.T) { // check seen bottom threshold only func TestVoteTrackerPeriodBottomOnly(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := nextThresholdHelper{} b := testCaseBuilder{} @@ -189,7 +189,7 @@ func TestVoteTrackerPeriodBottomOnly(t *testing.T) { // check seen both bottom and value threshodl func TestVoteTrackerPeriodValueAndBottom(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := nextThresholdHelper{} b := testCaseBuilder{} @@ -213,7 +213,7 @@ func TestVoteTrackerPeriodValueAndBottom(t *testing.T) { /* VoteTrackerRound Tests */ func TestVoteTrackerRoundUpdatesFreshest(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := nextThresholdHelper{} b := testCaseBuilder{} @@ -233,7 +233,7 @@ func TestVoteTrackerRoundUpdatesFreshest(t *testing.T) { } func TestVoteTrackerRoundUpdatesFreshestNextOverSoft(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := nextThresholdHelper{} b := testCaseBuilder{} @@ -259,7 +259,7 @@ func TestVoteTrackerRoundUpdatesFreshestNextOverSoft(t *testing.T) { } func TestVoteTrackerRoundUpdatesFreshestPeriod(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := nextThresholdHelper{} b := testCaseBuilder{} @@ -285,7 +285,7 @@ func TestVoteTrackerRoundUpdatesFreshestPeriod(t *testing.T) { } func TestVoteTrackerRoundUpdatesFreshestBot(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := nextThresholdHelper{} b := testCaseBuilder{} @@ -316,7 +316,7 @@ func TestVoteTrackerRoundUpdatesFreshestBot(t *testing.T) { } func TestVoteTrackerRoundForwardsVoteAccepted(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // check forwards vote accepted, and returns only a fresh bundle // this is really a test on the composition of machines. We should build diff --git a/agreement/voteTracker_test.go b/agreement/voteTracker_test.go index 07146ed2ba..2cec6b83b6 100644 --- a/agreement/voteTracker_test.go +++ b/agreement/voteTracker_test.go @@ -23,7 +23,7 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // todo: test validity of threshold events (incl. bundles) @@ -37,7 +37,7 @@ func makeVoteTrackerZero() listener { // actual tests func TestVoteTrackerNoOp(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -61,7 +61,7 @@ func TestVoteTrackerNoOp(t *testing.T) { } func TestVoteTrackerSoftQuorum(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -105,7 +105,7 @@ func TestVoteTrackerSoftQuorum(t *testing.T) { // sanity check for cert quorums func TestVoteTrackerCertQuorum(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -148,7 +148,7 @@ func TestVoteTrackerCertQuorum(t *testing.T) { // sanity check for next quorums func TestVoteTrackerNextQuorum(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -191,7 +191,7 @@ func TestVoteTrackerNextQuorum(t *testing.T) { // sanity check propose votes don't trigger anything func TestVoteTrackerProposeNoOp(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -219,7 +219,7 @@ func TestVoteTrackerProposeNoOp(t *testing.T) { } func TestVoteTrackerEquivocatorWeightCountedOnce(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -249,7 +249,7 @@ func TestVoteTrackerEquivocatorWeightCountedOnce(t *testing.T) { } func TestVoteTrackerEquivDoesntReemitThreshold(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -287,7 +287,7 @@ func TestVoteTrackerEquivDoesntReemitThreshold(t *testing.T) { } func TestVoteTrackerEquivocationsCount(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -336,7 +336,7 @@ func TestVoteTrackerEquivocationsCount(t *testing.T) { // same test as before, except equivocations voting v2, v3 should also count towards quorum for v1 func TestVoteTrackerSuperEquivocationsCount(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -389,7 +389,7 @@ func TestVoteTrackerSuperEquivocationsCount(t *testing.T) { // check that SM panics on seeing two quorums func TestVoteTrackerPanicsOnTwoSoftQuorums(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -432,7 +432,7 @@ func TestVoteTrackerPanicsOnTwoSoftQuorums(t *testing.T) { // check that SM panics on seeing soft quorum for bot (currently enforced by contract) func TestVoteTrackerPanicsOnSoftBotQuorum(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -465,7 +465,7 @@ func TestVoteTrackerPanicsOnSoftBotQuorum(t *testing.T) { // check that SM panics on seeing two next quorums, in particular bot, val in same step. func TestVoteTrackerPanicsOnTwoNextQuorums(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -505,7 +505,7 @@ func TestVoteTrackerPanicsOnTwoNextQuorums(t *testing.T) { } func TestVoteTrackerRejectsTooManyEquivocators(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -535,7 +535,7 @@ func TestVoteTrackerRejectsTooManyEquivocators(t *testing.T) { /* tests for filtering component of vote tracker */ func TestVoteTrackerFiltersDuplicateVoteOnce(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -567,7 +567,7 @@ func TestVoteTrackerFiltersDuplicateVoteOnce(t *testing.T) { } func TestVoteTrackerForwardsFirstEquivocation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -636,7 +636,7 @@ func TestVoteTrackerForwardsFirstEquivocation(t *testing.T) { } func TestVoteTrackerFiltersFutureEquivocations(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) helper := voteMakerHelper{} helper.Setup() @@ -683,7 +683,7 @@ func TestVoteTrackerFiltersFutureEquivocations(t *testing.T) { /* Check that machine panics on unknown event */ func TestVoteTrackerRejectsUnknownEvent(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testCase := determisticTraceTestCase{ inputs: []event{ diff --git a/agreement/vote_test.go b/agreement/vote_test.go index 07d158bcee..7c5ed7855f 100644 --- a/agreement/vote_test.go +++ b/agreement/vote_test.go @@ -28,7 +28,7 @@ import ( "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // error is set if this address is not selected @@ -44,7 +44,7 @@ func makeVoteTesting(addr basics.Address, vrfSecs *crypto.VRFSecrets, otSecs cry } func TestVoteValidation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numAddresses := 50 ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() @@ -118,7 +118,7 @@ func TestVoteValidation(t *testing.T) { } func TestVoteReproposalValidation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numAddresses := 50 ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() @@ -178,7 +178,7 @@ func TestVoteReproposalValidation(t *testing.T) { } func TestVoteMakeVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() @@ -219,7 +219,7 @@ func makeVotePanicWrapper(t *testing.T, message string, rv rawVote, voting crypt } func TestVoteValidationStepCertAndProposalBottom(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() round := ledger.NextRound() @@ -250,7 +250,7 @@ func TestVoteValidationStepCertAndProposalBottom(t *testing.T) { // Test Equivocation Vote Validation func TestEquivocationVoteValidation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numAddresses := 50 ledger, addresses, vrfSecrets, otSecrets := readOnlyFixture100() diff --git a/catchup/ledgerFetcher_test.go b/catchup/ledgerFetcher_test.go index ddf7f3b23f..73404f8730 100644 --- a/catchup/ledgerFetcher_test.go +++ b/catchup/ledgerFetcher_test.go @@ -31,7 +31,7 @@ import ( "github.com/algorand/go-algorand/ledger" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type dummyLedgerFetcherReporter struct { @@ -41,7 +41,7 @@ func (lf *dummyLedgerFetcherReporter) updateLedgerFetcherProgress(*ledger.Catchp } func TestNoPeersAvailable(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) lf := makeLedgerFetcher(&mocks.MockNetwork{}, &mocks.MockCatchpointCatchupAccessor{}, logging.TestingLog(t), &dummyLedgerFetcherReporter{}, config.GetDefaultLocal()) var peer network.Peer @@ -51,7 +51,7 @@ func TestNoPeersAvailable(t *testing.T) { } func TestNonParsableAddress(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) lf := makeLedgerFetcher(&mocks.MockNetwork{}, &mocks.MockCatchpointCatchupAccessor{}, logging.TestingLog(t), &dummyLedgerFetcherReporter{}, config.GetDefaultLocal()) peer := testHTTPPeer(":def") @@ -60,7 +60,7 @@ func TestNonParsableAddress(t *testing.T) { } func TestLedgerFetcherErrorResponseHandling(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // create a dummy server. mux := http.NewServeMux() diff --git a/catchup/peerSelector_test.go b/catchup/peerSelector_test.go index c526194750..5c7bb93441 100644 --- a/catchup/peerSelector_test.go +++ b/catchup/peerSelector_test.go @@ -29,7 +29,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type mockHTTPPeer struct { @@ -64,7 +64,7 @@ func (d *mockUnicastPeer) Respond(ctx context.Context, reqMsg network.IncomingMe } func TestPeerAddress(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) httpPeer := &mockHTTPPeer{address: "12345"} require.Equal(t, "12345", peerAddress(httpPeer)) @@ -77,7 +77,7 @@ func TestPeerAddress(t *testing.T) { } func TestDownloadDurationToRank(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // verify mid value require.Equal(t, 1500, downloadDurationToRank(50*time.Millisecond, 0*time.Millisecond, 100*time.Millisecond, 1000, 2000)) @@ -117,7 +117,7 @@ func makePeersRetrieverStub(fnc func(options ...network.PeerOption) []network.Pe } } func TestPeerSelector(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers := []network.Peer{&mockHTTPPeer{address: "12345"}} @@ -177,7 +177,7 @@ func TestPeerSelector(t *testing.T) { } func TestPeerDownloadRanking(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers1 := []network.Peer{&mockHTTPPeer{address: "1234"}, &mockHTTPPeer{address: "5678"}} peers2 := []network.Peer{&mockHTTPPeer{address: "abcd"}, &mockHTTPPeer{address: "efgh"}} @@ -228,7 +228,7 @@ func TestPeerDownloadRanking(t *testing.T) { } func TestFindMissingPeer(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peerSelector := makePeerSelector( makePeersRetrieverStub(func(options ...network.PeerOption) []network.Peer { @@ -242,7 +242,7 @@ func TestFindMissingPeer(t *testing.T) { } func TestHistoricData(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers1 := []network.Peer{&mockHTTPPeer{address: "a1"}, &mockHTTPPeer{address: "a2"}, &mockHTTPPeer{address: "a3"}} peers2 := []network.Peer{&mockHTTPPeer{address: "b1"}, &mockHTTPPeer{address: "b2"}} @@ -315,7 +315,7 @@ func peerSelectorTestRandVal(t *testing.T, seed int) float64 { return randVal } func TestPeersDownloadFailed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers1 := []network.Peer{&mockHTTPPeer{address: "a1"}, &mockHTTPPeer{address: "a2"}, &mockHTTPPeer{address: "a3"}} peers2 := []network.Peer{&mockHTTPPeer{address: "b1"}, &mockHTTPPeer{address: "b2"}} @@ -390,7 +390,7 @@ func TestPeersDownloadFailed(t *testing.T) { // TestPenalty tests that the penalty is calculated correctly and one peer // is not dominating all the selection. func TestPenalty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers1 := []network.Peer{&mockHTTPPeer{address: "a1"}, &mockHTTPPeer{address: "a2"}, &mockHTTPPeer{address: "a3"}} peers2 := []network.Peer{&mockHTTPPeer{address: "b1"}, &mockHTTPPeer{address: "b2"}} @@ -448,7 +448,7 @@ func TestPenalty(t *testing.T) { // TestPeerDownloadDurationToRank tests all the cases handled by peerDownloadDurationToRank func TestPeerDownloadDurationToRank(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers1 := []network.Peer{&mockHTTPPeer{address: "a1"}, &mockHTTPPeer{address: "a2"}, &mockHTTPPeer{address: "a3"}} peers2 := []network.Peer{&mockHTTPPeer{address: "b1"}, &mockHTTPPeer{address: "b2"}} @@ -489,7 +489,7 @@ func TestPeerDownloadDurationToRank(t *testing.T) { } func TestLowerUpperBounds(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) classes := []peerClass{{initialRank: peerRankInitialFirstPriority, peerClass: network.PeersPhonebookArchivers}, {initialRank: peerRankInitialSecondPriority, peerClass: network.PeersPhonebookRelays}, @@ -508,7 +508,7 @@ func TestLowerUpperBounds(t *testing.T) { } func TestFullResetRequestPenalty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) class := peerClass{initialRank: 10, peerClass: network.PeersPhonebookArchivers} hs := makeHistoricStatus(10, class) @@ -523,7 +523,7 @@ func TestFullResetRequestPenalty(t *testing.T) { // This was a bug where the resetRequestPenalty was not bounding the returned rank, and was having download failures. // Initializing rankSamples to 0 makes this works, since the dropped value subtracts 0 from rankSum. func TestClassUpperBound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers1 := []network.Peer{&mockHTTPPeer{address: "a1"}, &mockHTTPPeer{address: "a2"}} pClass := peerClass{initialRank: peerRankInitialSecondPriority, peerClass: network.PeersPhonebookArchivers} @@ -557,7 +557,7 @@ func TestClassUpperBound(t *testing.T) { // This was a bug where the resetRequestPenalty was not bounding the returned rank, and the rankSum was not // initialized to give the average of class.initialRank func TestClassLowerBound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers1 := []network.Peer{&mockHTTPPeer{address: "a1"}, &mockHTTPPeer{address: "a2"}} pClass := peerClass{initialRank: peerRankInitialSecondPriority, peerClass: network.PeersPhonebookArchivers} @@ -586,7 +586,7 @@ func TestClassLowerBound(t *testing.T) { // TestEviction tests that the peer is evicted after several download failures, and it handles same address for different peer classes func TestEvictionAndUpgrade(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers1 := []network.Peer{&mockHTTPPeer{address: "a1"}} peers2 := []network.Peer{&mockHTTPPeer{address: "a1"}} diff --git a/catchup/service_test.go b/catchup/service_test.go index 4207ffd9a9..a0df457a11 100644 --- a/catchup/service_test.go +++ b/catchup/service_test.go @@ -40,7 +40,7 @@ import ( "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/rpcs" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/execpool" ) @@ -130,7 +130,7 @@ func (auth *mockedAuthenticator) alter(errorRound int, fail bool) { } func TestServiceFetchBlocksSameRange(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make Ledgers local := new(mockedLedger) @@ -181,7 +181,7 @@ func (cl *periodicSyncLogger) Warnf(s string, args ...interface{}) { } func TestPeriodicSync(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make Ledger local := new(mockedLedger) @@ -245,7 +245,7 @@ func TestPeriodicSync(t *testing.T) { } func TestServiceFetchBlocksOneBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make Ledger numBlocks := 10 @@ -303,7 +303,7 @@ func TestServiceFetchBlocksOneBlock(t *testing.T) { // When caught up, and the agreement service is taking the lead, the sync() stops and // yields to the agreement. Agreement is emulated by the go func() loop in the test func TestAbruptWrites(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numberOfBlocks := 100 @@ -363,7 +363,7 @@ func TestAbruptWrites(t *testing.T) { } func TestServiceFetchBlocksMultiBlocks(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make Ledger numberOfBlocks := basics.Round(100) @@ -421,7 +421,7 @@ func TestServiceFetchBlocksMultiBlocks(t *testing.T) { } func TestServiceFetchBlocksMalformed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make Ledger numBlocks := 10 @@ -465,7 +465,7 @@ func TestServiceFetchBlocksMalformed(t *testing.T) { // Test the interruption in the initial loop // This cannot happen in practice, but is used to test the code. func TestOnSwitchToUnSupportedProtocol1(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) lastRoundRemote := 5 lastRoundLocal := 0 @@ -484,7 +484,7 @@ func TestOnSwitchToUnSupportedProtocol1(t *testing.T) { // Test the interruption in "the rest" loop func TestOnSwitchToUnSupportedProtocol2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) lastRoundRemote := 10 lastRoundLocal := 7 @@ -506,7 +506,7 @@ func TestOnSwitchToUnSupportedProtocol2(t *testing.T) { // This can not happen in practice, because there will be // enough rounds for the protocol upgrade notice. func TestOnSwitchToUnSupportedProtocol3(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) lastRoundRemote := 14 lastRoundLocal := 7 @@ -532,7 +532,7 @@ func TestOnSwitchToUnSupportedProtocol3(t *testing.T) { // happen when the catchup service restart at the round when // an upgrade happens. func TestOnSwitchToUnSupportedProtocol4(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) lastRoundRemote := 14 lastRoundLocal := 7 @@ -774,7 +774,7 @@ func (s *Service) testStart() { } func TestCatchupUnmatchedCertificate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make Ledger numBlocks := 10 @@ -819,7 +819,7 @@ func TestCatchupUnmatchedCertificate(t *testing.T) { // TestCreatePeerSelector tests if the correct peer selector coonfigurations are prepared func TestCreatePeerSelector(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make Service cfg := defaultConfig @@ -944,7 +944,7 @@ func TestCreatePeerSelector(t *testing.T) { } func TestServiceStartStop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cfg := defaultConfig ledger := new(mockedLedger) @@ -957,7 +957,7 @@ func TestServiceStartStop(t *testing.T) { } func TestSynchronizingTime(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cfg := defaultConfig ledger := new(mockedLedger) diff --git a/catchup/universalFetcher_test.go b/catchup/universalFetcher_test.go index 6cdc193d29..28cd0b566e 100644 --- a/catchup/universalFetcher_test.go +++ b/catchup/universalFetcher_test.go @@ -34,12 +34,12 @@ import ( "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/rpcs" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestUGetBlockWs tests the universal fetcher ws peer case func TestUGetBlockWs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cfg := config.GetDefaultLocal() @@ -81,7 +81,7 @@ func TestUGetBlockWs(t *testing.T) { // TestUGetBlockHTTP tests the universal fetcher http peer case func TestUGetBlockHTTP(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cfg := config.GetDefaultLocal() @@ -127,7 +127,7 @@ func TestUGetBlockHTTP(t *testing.T) { // TestUGetBlockUnsupported tests the handling of an unsupported peer func TestUGetBlockUnsupported(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) fetcher := universalBlockFetcher{} peer := "" @@ -141,7 +141,7 @@ func TestUGetBlockUnsupported(t *testing.T) { // TestprocessBlockBytesErrors checks the error handling in processBlockBytes func TestProcessBlockBytesErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) blk := bookkeeping.Block{ BlockHeader: bookkeeping.BlockHeader{ @@ -173,7 +173,7 @@ func TestProcessBlockBytesErrors(t *testing.T) { // TestRequestBlockBytesErrors checks the error handling in requestBlockBytes func TestRequestBlockBytesErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cfg := config.GetDefaultLocal() @@ -239,7 +239,7 @@ func (thh *TestHTTPHandler) ServeHTTP(response http.ResponseWriter, request *htt // TestGetBlockBytesHTTPErrors tests the errors reported from getblockBytes for http peer func TestGetBlockBytesHTTPErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cfg := config.GetDefaultLocal() net := &httpTestPeerSource{} @@ -288,7 +288,7 @@ func (et ErrTest) Error() string { // TestErrorTypes tests the error types are implemented correctly func TestErrorTypes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) err1 := makeErrWrongCertFromPeer(1, 2, "somepeer1") require.Equal(t, "processBlockBytes: got wrong cert from peer somepeer1: wanted 1, got 2", err1.Error()) diff --git a/compactcert/db_test.go b/compactcert/db_test.go index 7e3f2c3774..e34eb8fbbc 100644 --- a/compactcert/db_test.go +++ b/compactcert/db_test.go @@ -28,7 +28,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" ) @@ -49,7 +49,7 @@ func dbOpenTest(t testing.TB, inMemory bool) (db.Pair, string) { } func TestPendingSigDB(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dbs, _ := dbOpenTest(t, true) defer dbs.Close() diff --git a/compactcert/msgp_gen_test.go b/compactcert/msgp_gen_test.go index 0dfe6fb0a1..14f9e1cb65 100644 --- a/compactcert/msgp_gen_test.go +++ b/compactcert/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalsigFromAddr(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := sigFromAddr{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalsigFromAddr(t *testing.T) { } func TestRandomizedEncodingsigFromAddr(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &sigFromAddr{}) } diff --git a/compactcert/worker_test.go b/compactcert/worker_test.go index 15200236bd..e8b2554cc9 100644 --- a/compactcert/worker_test.go +++ b/compactcert/worker_test.go @@ -38,7 +38,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" "github.com/algorand/go-deadlock" ) @@ -214,7 +214,7 @@ func newPartKey(t testing.TB, parent basics.Address) account.Participation { } func TestWorkerAllSigs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var keys []account.Participation for i := 0; i < 10; i++ { @@ -276,7 +276,7 @@ func TestWorkerAllSigs(t *testing.T) { } func TestWorkerPartialSigs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var keys []account.Participation for i := 0; i < 7; i++ { @@ -334,7 +334,7 @@ func TestWorkerPartialSigs(t *testing.T) { } func TestWorkerInsufficientSigs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var keys []account.Participation for i := 0; i < 2; i++ { @@ -365,7 +365,7 @@ func TestWorkerInsufficientSigs(t *testing.T) { } func TestLatestSigsFromThisNode(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var keys []account.Participation for i := 0; i < 10; i++ { @@ -404,7 +404,7 @@ func TestLatestSigsFromThisNode(t *testing.T) { } func TestWorkerRestart(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var keys []account.Participation for i := 0; i < 10; i++ { @@ -445,7 +445,7 @@ func TestWorkerRestart(t *testing.T) { } func TestWorkerHandleSig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var keys []account.Participation for i := 0; i < 2; i++ { diff --git a/config/config_test.go b/config/config_test.go index 9158c16c5f..0c8033279f 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -29,7 +29,7 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/codecs" ) @@ -42,7 +42,7 @@ var defaultConfig = Local{ } func TestSaveThenLoad(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) c1, err := loadWithoutDefaults(defaultConfig) require.NoError(t, err) @@ -71,7 +71,7 @@ func TestSaveThenLoad(t *testing.T) { } func TestLoadMissing(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) os.RemoveAll("testdir") _, err := LoadConfigFromDisk("testdir") @@ -79,7 +79,7 @@ func TestLoadMissing(t *testing.T) { } func TestMergeConfig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) os.RemoveAll("testdir") err := os.Mkdir("testdir", 0777) @@ -146,7 +146,7 @@ var expectedMerged = []string{ } func TestLoadPhonebook(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) os.RemoveAll("testdir") err := os.Mkdir("testdir", 0777) @@ -165,7 +165,7 @@ func TestLoadPhonebook(t *testing.T) { } func TestLoadPhonebookMissing(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) os.RemoveAll("testdir") _, err := LoadPhonebook("testdir") @@ -173,13 +173,13 @@ func TestLoadPhonebookMissing(t *testing.T) { } func TestArchivalIfRelay(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testArchivalIfRelay(t, true) } func TestArchivalIfNotRelay(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testArchivalIfRelay(t, false) } @@ -218,7 +218,7 @@ func testArchivalIfRelay(t *testing.T, relay bool) { } func TestConfigExampleIsCorrect(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -261,7 +261,7 @@ func loadWithoutDefaults(cfg Local) (Local, error) { } func TestConfigMigrate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -288,7 +288,7 @@ func TestConfigMigrate(t *testing.T) { } func TestConfigMigrateFromDisk(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -311,7 +311,7 @@ func TestConfigMigrateFromDisk(t *testing.T) { // Verify that nobody is changing the shipping default configurations func TestConfigInvariant(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -328,7 +328,7 @@ func TestConfigInvariant(t *testing.T) { } func TestConfigLatestVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -337,7 +337,7 @@ func TestConfigLatestVersion(t *testing.T) { } func TestConsensusUpgrades(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -365,7 +365,7 @@ func consensusUpgradesTo(a *require.Assertions, currentName, targetName protocol } func TestConsensusLatestVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -375,7 +375,7 @@ func TestConsensusLatestVersion(t *testing.T) { } func TestLocal_DNSBootstrapArray(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type fields struct { DNSBootstrapID string @@ -418,7 +418,7 @@ func TestLocal_DNSBootstrapArray(t *testing.T) { } func TestLocal_DNSBootstrap(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type fields struct { DNSBootstrapID string @@ -466,7 +466,7 @@ func TestLocal_DNSBootstrap(t *testing.T) { } func TestLocalStructTags(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) localType := reflect.TypeOf(Local{}) @@ -509,7 +509,7 @@ func TestLocalStructTags(t *testing.T) { } func TestGetVersionedDefaultLocalConfig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for i := uint32(0); i < getLatestConfigVersion(); i++ { localVersion := getVersionedDefaultLocalConfig(i) @@ -519,7 +519,7 @@ func TestGetVersionedDefaultLocalConfig(t *testing.T) { // TestLocalVersionField - ensures the Version contains only versions tags, the versions are all contiguous, and that no non-version tags are included there. func TestLocalVersionField(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) localType := reflect.TypeOf(Local{}) field, ok := localType.FieldByName("Version") diff --git a/config/consensus_test.go b/config/consensus_test.go index 84b4a483a5..6cdc2ebd12 100644 --- a/config/consensus_test.go +++ b/config/consensus_test.go @@ -19,12 +19,12 @@ package config import ( "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestConsensusParams(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for proto, params := range Consensus { // Our implementation of Payset.Commit() assumes that @@ -42,7 +42,7 @@ func TestConsensusParams(t *testing.T) { // TestConsensusUpgradeWindow ensures that the upgrade window is a non-zero value, and confirm to be within the valid range. func TestConsensusUpgradeWindow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for proto, params := range Consensus { require.GreaterOrEqualf(t, params.MaxUpgradeWaitRounds, params.MinUpgradeWaitRounds, "Version :%v", proto) diff --git a/crypto/compactcert/bigfloat_test.go b/crypto/compactcert/bigfloat_test.go index 4c217aa579..354821adde 100644 --- a/crypto/compactcert/bigfloat_test.go +++ b/crypto/compactcert/bigfloat_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func rand32() uint32 { @@ -31,7 +31,7 @@ func rand32() uint32 { } func TestBigFloatRounding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := &bigFloatDn{} b := &bigFloatUp{} @@ -65,7 +65,7 @@ func TestBigFloatRounding(t *testing.T) { } func TestBigFloat(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := &bigFloatDn{} b := &bigFloatDn{} diff --git a/crypto/compactcert/builder_test.go b/crypto/compactcert/builder_test.go index ec20746d52..0bab55da74 100644 --- a/crypto/compactcert/builder_test.go +++ b/crypto/compactcert/builder_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -52,7 +52,7 @@ func (pc PartCommit) GetHash(pos uint64) (crypto.Digest, error) { } func TestBuildVerify(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Doing a full test of 1M accounts takes too much CPU time in CI. doLargeTest := false @@ -223,7 +223,7 @@ func BenchmarkBuildVerify(b *testing.B) { } func TestCoinIndex(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) n := 1000 b := &Builder{ diff --git a/crypto/compactcert/common_test.go b/crypto/compactcert/common_test.go index 7ac0a4e5a2..ce26e4c15f 100644 --- a/crypto/compactcert/common_test.go +++ b/crypto/compactcert/common_test.go @@ -20,11 +20,11 @@ import ( "testing" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestHashCoin(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var slots [32]uint64 var sigcom [32]byte @@ -87,7 +87,7 @@ func BenchmarkHashCoin(b *testing.B) { } func TestNumReveals(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) billion := uint64(1000 * 1000 * 1000) microalgo := uint64(1000 * 1000) diff --git a/crypto/compactcert/msgp_gen_test.go b/crypto/compactcert/msgp_gen_test.go index 03eb73d08c..4c698bf4d5 100644 --- a/crypto/compactcert/msgp_gen_test.go +++ b/crypto/compactcert/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Cert{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalCert(t *testing.T) { } func TestRandomizedEncodingCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Cert{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalCert(b *testing.B) { } func TestMarshalUnmarshalCompactOneTimeSignature(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := CompactOneTimeSignature{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalCompactOneTimeSignature(t *testing.T) { } func TestRandomizedEncodingCompactOneTimeSignature(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &CompactOneTimeSignature{}) } @@ -139,7 +139,7 @@ func BenchmarkUnmarshalCompactOneTimeSignature(b *testing.B) { } func TestMarshalUnmarshalParticipant(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Participant{} bts := v.MarshalMsg(nil) @@ -161,7 +161,7 @@ func TestMarshalUnmarshalParticipant(t *testing.T) { } func TestRandomizedEncodingParticipant(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Participant{}) } @@ -202,7 +202,7 @@ func BenchmarkUnmarshalParticipant(b *testing.B) { } func TestMarshalUnmarshalReveal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Reveal{} bts := v.MarshalMsg(nil) @@ -224,7 +224,7 @@ func TestMarshalUnmarshalReveal(t *testing.T) { } func TestRandomizedEncodingReveal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Reveal{}) } @@ -265,7 +265,7 @@ func BenchmarkUnmarshalReveal(b *testing.B) { } func TestMarshalUnmarshalcoinChoice(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := coinChoice{} bts := v.MarshalMsg(nil) @@ -287,7 +287,7 @@ func TestMarshalUnmarshalcoinChoice(t *testing.T) { } func TestRandomizedEncodingcoinChoice(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &coinChoice{}) } @@ -328,7 +328,7 @@ func BenchmarkUnmarshalcoinChoice(b *testing.B) { } func TestMarshalUnmarshalsigslotCommit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := sigslotCommit{} bts := v.MarshalMsg(nil) @@ -350,7 +350,7 @@ func TestMarshalUnmarshalsigslotCommit(t *testing.T) { } func TestRandomizedEncodingsigslotCommit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &sigslotCommit{}) } diff --git a/crypto/merklearray/layer_test.go b/crypto/merklearray/layer_test.go index 770a69f97a..96418757f2 100644 --- a/crypto/merklearray/layer_test.go +++ b/crypto/merklearray/layer_test.go @@ -20,11 +20,11 @@ import ( "testing" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLayerHash(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var p pair crypto.RandBytes(p.l[:]) diff --git a/crypto/merklearray/merkle_test.go b/crypto/merklearray/merkle_test.go index 564f6728e7..765ce61900 100644 --- a/crypto/merklearray/merkle_test.go +++ b/crypto/merklearray/merkle_test.go @@ -22,7 +22,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type TestMessage string @@ -75,7 +75,7 @@ func (a TestRepeatingArray) GetHash(pos uint64) (crypto.Digest, error) { } func TestMerkle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var junk TestData crypto.RandBytes(junk[:]) diff --git a/crypto/merkletrie/bitset_test.go b/crypto/merkletrie/bitset_test.go index 46e5565532..c722ff4536 100644 --- a/crypto/merkletrie/bitset_test.go +++ b/crypto/merkletrie/bitset_test.go @@ -20,12 +20,12 @@ import ( "math/bits" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestBitSet(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var a, b bitset @@ -66,7 +66,7 @@ func TestBitSet(t *testing.T) { // TestBitSetOneBit test that only one bit is being set when we call SetBit func TestBitSetOneBit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for i := 0; i < 256; i++ { var a bitset diff --git a/crypto/merkletrie/cache_test.go b/crypto/merkletrie/cache_test.go index 029c191f19..07819644ec 100644 --- a/crypto/merkletrie/cache_test.go +++ b/crypto/merkletrie/cache_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var defaultTestMemoryConfig = MemoryConfig{ @@ -51,7 +51,7 @@ func verifyCacheNodeCount(t *testing.T, trie *Trie) { } func TestCacheEviction1(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter InMemoryCommitter mt1, _ := MakeTrie(&memoryCommitter, defaultTestMemoryConfig) @@ -75,7 +75,7 @@ func TestCacheEviction1(t *testing.T) { } func TestCacheEviction2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter InMemoryCommitter mt1, _ := MakeTrie(&memoryCommitter, defaultTestMemoryConfig) @@ -104,7 +104,7 @@ func TestCacheEviction2(t *testing.T) { } func TestCacheEviction3(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter InMemoryCommitter mt1, _ := MakeTrie(&memoryCommitter, defaultTestMemoryConfig) @@ -192,7 +192,7 @@ func cacheEvictionFuzzer(t *testing.T, hashes []crypto.Digest, pageSize int64, e // TestCacheEvictionFuzzer generates bursts of random Add/Delete operations on the trie, and // testing the correctness of the cache internal buffers priodically. func TestCacheEvictionFuzzer(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // create 2000 hashes. leafsCount := 2000 @@ -212,7 +212,7 @@ func TestCacheEvictionFuzzer(t *testing.T) { // TestCacheEvictionFuzzer generates bursts of random Add/Delete operations on the trie, and // testing the correctness of the cache internal buffers priodically. func TestCacheEvictionFuzzer2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // create 1000 hashes. leafsCount := 1000 @@ -234,7 +234,7 @@ func TestCacheEvictionFuzzer2(t *testing.T) { // delete a in-memory page during merkleTrieCache.commitTransaction(), // it's being deleted correctly. func TestCacheMidTransactionPageDeletion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter smallPageMemoryCommitter memoryConfig := defaultTestMemoryConfig @@ -321,7 +321,7 @@ func (mt *Trie) TestDeleteRollback(d []byte) (bool, error) { // delete a in-memory page during merkleTrieCache.rollbackTransaction(), // it's being deleted correctly. func TestCacheTransactionRollbackPageDeletion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter smallPageMemoryCommitter memConfig := defaultTestMemoryConfig @@ -364,7 +364,7 @@ func TestCacheTransactionRollbackPageDeletion(t *testing.T) { // delete a in-memory page during merkleTrieCache.deleteNode(), // it's being deleted correctly. func TestCacheDeleteNodeMidTransaction(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter smallPageMemoryCommitter memConfig := defaultTestMemoryConfig @@ -399,7 +399,7 @@ func TestCacheDeleteNodeMidTransaction(t *testing.T) { // TestCachePageLoading ensures that during page loading, the number of cachedNodeCount is not // increased if the page was already loaded previously into memory. func TestCachePageReloading(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter InMemoryCommitter mt1, _ := MakeTrie(&memoryCommitter, defaultTestMemoryConfig) @@ -441,7 +441,7 @@ func TestCachePageReloading(t *testing.T) { // TestCachePagedOutTip verifies that the evict function would prioritize // evicting other pages before evicting the top page. func TestCachePagedOutTip(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter InMemoryCommitter memConfig := defaultTestMemoryConfig @@ -479,7 +479,7 @@ func TestCachePagedOutTip(t *testing.T) { // TestCacheLoadingDeferedPage verifies that the loadPage // method correcly resets the mtc.deferedPageLoad on the correct page. func TestCacheLoadingDeferedPage(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter1 InMemoryCommitter mt1, _ := MakeTrie(&memoryCommitter1, defaultTestMemoryConfig) diff --git a/crypto/merkletrie/committer_test.go b/crypto/merkletrie/committer_test.go index 5180163bef..04a43a1b22 100644 --- a/crypto/merkletrie/committer_test.go +++ b/crypto/merkletrie/committer_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // Duplicate duplicates the current memory committer. @@ -42,7 +42,7 @@ func (mc *InMemoryCommitter) Duplicate(flat bool) (out *InMemoryCommitter) { } func TestInMemoryCommitter(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter InMemoryCommitter mt1, _ := MakeTrie(&memoryCommitter, defaultTestMemoryConfig) @@ -104,7 +104,7 @@ func (n *node) getChildren() (list []storedNodeIdentifier) { } func TestNoRedundentPages(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter InMemoryCommitter mt1, _ := MakeTrie(&memoryCommitter, defaultTestMemoryConfig) @@ -157,7 +157,7 @@ func decodePageHeaderSize(bytes []byte) (headerSize int, err error) { } func TestMultipleCommits(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testSize := 5000 commitsCount := 5 @@ -202,7 +202,7 @@ func TestMultipleCommits(t *testing.T) { } func TestIterativeCommits(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testSize := 1000 diff --git a/crypto/merkletrie/node_test.go b/crypto/merkletrie/node_test.go index e1918323e9..db4f02bdf9 100644 --- a/crypto/merkletrie/node_test.go +++ b/crypto/merkletrie/node_test.go @@ -22,12 +22,12 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestNodeSerialization tests the serialization and deserialization of nodes. func TestNodeSerialization(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var memoryCommitter InMemoryCommitter memConfig := defaultTestMemoryConfig diff --git a/crypto/merkletrie/trie_test.go b/crypto/merkletrie/trie_test.go index 778397c8dc..82f86b2d19 100644 --- a/crypto/merkletrie/trie_test.go +++ b/crypto/merkletrie/trie_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) const ( @@ -31,7 +31,7 @@ const ( ) func TestAddingAndRemoving(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) mt, _ := MakeTrie(nil, defaultTestMemoryConfig) // create 10000 hashes. @@ -85,7 +85,7 @@ func TestAddingAndRemoving(t *testing.T) { } func TestRandomAddingAndRemoving(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) mt, err := MakeTrie(nil, defaultTestMemoryConfig) require.NoError(t, err) diff --git a/crypto/passphrase/passphrase_test.go b/crypto/passphrase/passphrase_test.go index 1dbcd3af44..fc4b399d13 100644 --- a/crypto/passphrase/passphrase_test.go +++ b/crypto/passphrase/passphrase_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestGenerateAndRecovery(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) key := make([]byte, 32) for i := 0; i < 1000; i++ { @@ -45,7 +45,7 @@ func TestGenerateAndRecovery(t *testing.T) { } func TestZeroVector(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) zeroVector := []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} mn := "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon invest" @@ -57,7 +57,7 @@ func TestZeroVector(t *testing.T) { } func TestWordNotInList(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) mn := "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon zzz invest" _, err := MnemonicToKey(mn) @@ -66,7 +66,7 @@ func TestWordNotInList(t *testing.T) { } func TestCorruptedChecksum(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) key := make([]byte, 32) _, err := rand.Read(key) @@ -82,7 +82,7 @@ func TestCorruptedChecksum(t *testing.T) { } func TestInvalidKeyLen(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) badLens := []int{0, 31, 33, 100} for _, l := range badLens { @@ -96,7 +96,7 @@ func TestInvalidKeyLen(t *testing.T) { } func TestUint11Array(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) N := 11*8*32 + 1 diff --git a/daemon/algod/deadlock_test.go b/daemon/algod/deadlock_test.go index b63e876e5f..1df1594e09 100644 --- a/daemon/algod/deadlock_test.go +++ b/daemon/algod/deadlock_test.go @@ -25,11 +25,11 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestDeadlockLogging(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) logFn := fmt.Sprintf("/tmp/test.%s.%d.log", t.Name(), crypto.RandUint64()) archiveFn := fmt.Sprintf("%s.archive", logFn) @@ -60,7 +60,7 @@ func TestDeadlockLogging(t *testing.T) { } func TestDeadlockOnPotentialDeadlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) logFn := fmt.Sprintf("/tmp/test.%s.%d.log", t.Name(), crypto.RandUint64()) archiveFn := fmt.Sprintf("%s.archive", logFn) diff --git a/daemon/algod/server_test.go b/daemon/algod/server_test.go index 712af151ea..d4a6a26eea 100644 --- a/daemon/algod/server_test.go +++ b/daemon/algod/server_test.go @@ -23,7 +23,7 @@ import ( "net" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -35,7 +35,7 @@ func isTCPPortAvailable(host string, port int) bool { return err == nil } func TestFirstListenerSetupGetsPort8080WhenPassedPortZero(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // this test will fail if there is already a listener on the testing machine's port 8080 // (except if a dev has a node running on port 8080 and runs the test; in that case, we can't run this test.) @@ -54,7 +54,7 @@ func TestFirstListenerSetupGetsPort8080WhenPassedPortZero(t *testing.T) { } func TestSecondListenerSetupGetsAnotherPortWhen8080IsBusy(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) defaultAddr := "127.0.0.1:0" unexpectedAddr := "127.0.0.1:8080" @@ -66,7 +66,7 @@ func TestSecondListenerSetupGetsAnotherPortWhen8080IsBusy(t *testing.T) { } func TestFirstListenerSetupGetsPassedPortWhenPassedPortNonZero(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) expectedAddr := "127.0.0.1:8081" listener, err := makeListener(expectedAddr) diff --git a/daemon/kmd/config/config.go b/daemon/kmd/config/config.go index f4c70c5a32..39827f2c74 100644 --- a/daemon/kmd/config/config.go +++ b/daemon/kmd/config/config.go @@ -45,6 +45,7 @@ type KMDConfig struct { // DriverConfig contains config info specific to each wallet driver type DriverConfig struct { SQLiteWalletDriverConfig SQLiteWalletDriverConfig `json:"sqlite"` + LedgerWalletDriverConfig LedgerWalletDriverConfig `json:"ledger"` } // SQLiteWalletDriverConfig is configuration specific to the SQLiteWalletDriver @@ -54,6 +55,11 @@ type SQLiteWalletDriverConfig struct { ScryptParams ScryptParams `json:"scrypt"` } +// LedgerWalletDriverConfig is configuration specific to the LedgerWalletDriver +type LedgerWalletDriverConfig struct { + Disable bool `json:"disable"` +} + // ScryptParams stores the parameters used for key derivation. This allows // upgrading security parameters over time type ScryptParams struct { diff --git a/daemon/kmd/wallet/driver/ledger.go b/daemon/kmd/wallet/driver/ledger.go index 74b9950b0e..7affe3a5c9 100644 --- a/daemon/kmd/wallet/driver/ledger.go +++ b/daemon/kmd/wallet/driver/ledger.go @@ -62,6 +62,7 @@ type LedgerWalletDriver struct { mu deadlock.Mutex wallets map[string]*LedgerWallet log logging.Logger + cfg config.LedgerWalletDriverConfig } // LedgerWallet represents a particular wallet under the @@ -108,6 +109,10 @@ func (lwd *LedgerWalletDriver) scanWalletsLocked() error { lwd.wallets = make(map[string]*LedgerWallet) } + if lwd.cfg.Disable { + return nil + } + // Enumerate attached wallet devices infos, err := LedgerEnumerate() if err != nil { @@ -179,6 +184,8 @@ func (lwd *LedgerWalletDriver) InitWithConfig(cfg config.KMDConfig, log logging. defer lwd.mu.Unlock() lwd.log = log + lwd.cfg = cfg.DriverConfig.LedgerWalletDriverConfig + return lwd.scanWalletsLocked() } diff --git a/data/account/participation_test.go b/data/account/participation_test.go index 7318486ed8..b92929b36a 100644 --- a/data/account/participation_test.go +++ b/data/account/participation_test.go @@ -28,12 +28,12 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" ) func TestParticipation_NewDB(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -89,7 +89,7 @@ func getSchemaVersions(db db.Accessor) (versions map[string]int, err error) { } func TestOverlapsInterval(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const before = basics.Round(95) const start = basics.Round(100) diff --git a/data/basics/address_test.go b/data/basics/address_test.go index 4c8276024d..f99f3392d9 100644 --- a/data/basics/address_test.go +++ b/data/basics/address_test.go @@ -23,11 +23,11 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestChecksumAddress_Unmarshal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) address := crypto.Hash([]byte("randomString")) shortAddress := Address(address) @@ -40,7 +40,7 @@ func TestChecksumAddress_Unmarshal(t *testing.T) { } func TestAddressChecksumMalformedWrongChecksum(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) address := crypto.Hash([]byte("randomString")) shortAddress := Address(address) @@ -52,7 +52,7 @@ func TestAddressChecksumMalformedWrongChecksum(t *testing.T) { } func TestAddressChecksumShort(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var address string _, err := UnmarshalChecksumAddress(address) @@ -60,7 +60,7 @@ func TestAddressChecksumShort(t *testing.T) { } func TestAddressChecksumMalformedWrongChecksumSpace(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) address := crypto.Hash([]byte("randomString")) shortAddress := Address(address) @@ -72,7 +72,7 @@ func TestAddressChecksumMalformedWrongChecksumSpace(t *testing.T) { } func TestAddressChecksumMalformedWrongAddress(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) address := crypto.Hash([]byte("randomString")) shortAddress := Address(address) @@ -84,7 +84,7 @@ func TestAddressChecksumMalformedWrongAddress(t *testing.T) { } func TestAddressChecksumMalformedWrongAddressSpaces(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) address := crypto.Hash([]byte("randomString")) shortAddress := Address(address) @@ -96,7 +96,7 @@ func TestAddressChecksumMalformedWrongAddressSpaces(t *testing.T) { } func TestAddressChecksumCanonical(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) addr := "J5YDZLPOHWB5O6MVRHNFGY4JXIQAYYM6NUJWPBSYBBIXH5ENQ4Z5LTJELU" nonCanonical := "J5YDZLPOHWB5O6MVRHNFGY4JXIQAYYM6NUJWPBSYBBIXH5ENQ4Z5LTJELV" @@ -113,7 +113,7 @@ type TestOb struct { } func TestAddressMarshalUnmarshal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var addr Address crypto.RandBytes(addr[:]) diff --git a/data/basics/msgp_gen_test.go b/data/basics/msgp_gen_test.go index 559e324f8b..4b78a6a382 100644 --- a/data/basics/msgp_gen_test.go +++ b/data/basics/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalAccountData(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AccountData{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalAccountData(t *testing.T) { } func TestRandomizedEncodingAccountData(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AccountData{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalAccountData(b *testing.B) { } func TestMarshalUnmarshalAppLocalState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AppLocalState{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalAppLocalState(t *testing.T) { } func TestRandomizedEncodingAppLocalState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AppLocalState{}) } @@ -139,7 +139,7 @@ func BenchmarkUnmarshalAppLocalState(b *testing.B) { } func TestMarshalUnmarshalAppParams(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AppParams{} bts := v.MarshalMsg(nil) @@ -161,7 +161,7 @@ func TestMarshalUnmarshalAppParams(t *testing.T) { } func TestRandomizedEncodingAppParams(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AppParams{}) } @@ -202,7 +202,7 @@ func BenchmarkUnmarshalAppParams(b *testing.B) { } func TestMarshalUnmarshalAssetHolding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AssetHolding{} bts := v.MarshalMsg(nil) @@ -224,7 +224,7 @@ func TestMarshalUnmarshalAssetHolding(t *testing.T) { } func TestRandomizedEncodingAssetHolding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AssetHolding{}) } @@ -265,7 +265,7 @@ func BenchmarkUnmarshalAssetHolding(b *testing.B) { } func TestMarshalUnmarshalAssetParams(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AssetParams{} bts := v.MarshalMsg(nil) @@ -287,7 +287,7 @@ func TestMarshalUnmarshalAssetParams(t *testing.T) { } func TestRandomizedEncodingAssetParams(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AssetParams{}) } @@ -328,7 +328,7 @@ func BenchmarkUnmarshalAssetParams(b *testing.B) { } func TestMarshalUnmarshalBalanceRecord(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := BalanceRecord{} bts := v.MarshalMsg(nil) @@ -350,7 +350,7 @@ func TestMarshalUnmarshalBalanceRecord(t *testing.T) { } func TestRandomizedEncodingBalanceRecord(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &BalanceRecord{}) } @@ -391,7 +391,7 @@ func BenchmarkUnmarshalBalanceRecord(b *testing.B) { } func TestMarshalUnmarshalEvalDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := EvalDelta{} bts := v.MarshalMsg(nil) @@ -413,7 +413,7 @@ func TestMarshalUnmarshalEvalDelta(t *testing.T) { } func TestRandomizedEncodingEvalDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &EvalDelta{}) } @@ -454,7 +454,7 @@ func BenchmarkUnmarshalEvalDelta(b *testing.B) { } func TestMarshalUnmarshalStateDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := StateDelta{} bts := v.MarshalMsg(nil) @@ -476,7 +476,7 @@ func TestMarshalUnmarshalStateDelta(t *testing.T) { } func TestRandomizedEncodingStateDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &StateDelta{}) } @@ -517,7 +517,7 @@ func BenchmarkUnmarshalStateDelta(b *testing.B) { } func TestMarshalUnmarshalStateSchema(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := StateSchema{} bts := v.MarshalMsg(nil) @@ -539,7 +539,7 @@ func TestMarshalUnmarshalStateSchema(t *testing.T) { } func TestRandomizedEncodingStateSchema(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &StateSchema{}) } @@ -580,7 +580,7 @@ func BenchmarkUnmarshalStateSchema(b *testing.B) { } func TestMarshalUnmarshalStateSchemas(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := StateSchemas{} bts := v.MarshalMsg(nil) @@ -602,7 +602,7 @@ func TestMarshalUnmarshalStateSchemas(t *testing.T) { } func TestRandomizedEncodingStateSchemas(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &StateSchemas{}) } @@ -643,7 +643,7 @@ func BenchmarkUnmarshalStateSchemas(b *testing.B) { } func TestMarshalUnmarshalTealKeyValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := TealKeyValue{} bts := v.MarshalMsg(nil) @@ -665,7 +665,7 @@ func TestMarshalUnmarshalTealKeyValue(t *testing.T) { } func TestRandomizedEncodingTealKeyValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &TealKeyValue{}) } @@ -706,7 +706,7 @@ func BenchmarkUnmarshalTealKeyValue(b *testing.B) { } func TestMarshalUnmarshalTealValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := TealValue{} bts := v.MarshalMsg(nil) @@ -728,7 +728,7 @@ func TestMarshalUnmarshalTealValue(t *testing.T) { } func TestRandomizedEncodingTealValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &TealValue{}) } @@ -769,7 +769,7 @@ func BenchmarkUnmarshalTealValue(b *testing.B) { } func TestMarshalUnmarshalValueDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := ValueDelta{} bts := v.MarshalMsg(nil) @@ -791,7 +791,7 @@ func TestMarshalUnmarshalValueDelta(t *testing.T) { } func TestRandomizedEncodingValueDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &ValueDelta{}) } diff --git a/data/basics/teal_test.go b/data/basics/teal_test.go index 99bea82d6a..35b4331e8f 100644 --- a/data/basics/teal_test.go +++ b/data/basics/teal_test.go @@ -24,11 +24,11 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestStateDeltaValid(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -85,7 +85,7 @@ func TestStateDeltaValid(t *testing.T) { } func TestStateDeltaValidV24(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -108,7 +108,7 @@ func TestStateDeltaValidV24(t *testing.T) { } func TestStateDeltaEqual(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -145,7 +145,7 @@ func TestStateDeltaEqual(t *testing.T) { } func TestEvalDeltaEqual(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/data/basics/units_test.go b/data/basics/units_test.go index b242827c4d..6ef8ba43e8 100644 --- a/data/basics/units_test.go +++ b/data/basics/units_test.go @@ -19,12 +19,12 @@ package basics import ( "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestSubSaturate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := Round(1) b := Round(2) @@ -34,7 +34,7 @@ func TestSubSaturate(t *testing.T) { } func TestRoundUpToMultipleOf(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) r := Round(24) for n := Round(1); n < Round(100); n++ { diff --git a/data/basics/userBalance_test.go b/data/basics/userBalance_test.go index aec98b2680..89b4901075 100644 --- a/data/basics/userBalance_test.go +++ b/data/basics/userBalance_test.go @@ -26,18 +26,18 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEmptyEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var ub BalanceRecord require.Equal(t, 1, len(protocol.Encode(&ub))) } func TestRewards(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] accountAlgos := []MicroAlgos{{Raw: 0}, {Raw: 8000}, {Raw: 13000}, {Raw: 83000}} @@ -59,7 +59,7 @@ func TestRewards(t *testing.T) { } func TestWithUpdatedRewardsPanics(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] t.Run("AlgoPanic", func(t *testing.T) { @@ -106,7 +106,7 @@ func makeString(len int) string { } func TestEncodedAccountDataSize(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) oneTimeSecrets := crypto.GenerateOneTimeSignatureSecrets(0, 1) vrfSecrets := crypto.GenerateVRFSecrets() @@ -212,7 +212,7 @@ func TestEncodedAccountDataSize(t *testing.T) { } func TestEncodedAccountAllocationBounds(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // ensure that all the supported protocols have value limits less or // equal to their corresponding codec allocbounds diff --git a/data/bookkeeping/block_test.go b/data/bookkeeping/block_test.go index aad6288475..671905594b 100644 --- a/data/bookkeeping/block_test.go +++ b/data/bookkeeping/block_test.go @@ -27,7 +27,7 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var delegatesMoney = basics.MicroAlgos{Raw: 1000 * 1000 * 1000} @@ -61,7 +61,7 @@ func init() { } func TestUpgradeVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) s := UpgradeState{ CurrentProtocol: proto1, @@ -124,7 +124,7 @@ func TestUpgradeVote(t *testing.T) { } func TestUpgradeVariableDelay(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) s := UpgradeState{ CurrentProtocol: protoDelay, @@ -150,7 +150,7 @@ func TestUpgradeVariableDelay(t *testing.T) { } func TestMakeBlockUpgrades(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var b Block b.BlockHeader.GenesisID = t.Name() @@ -202,7 +202,7 @@ func TestMakeBlockUpgrades(t *testing.T) { } func TestBlockUnsupported(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var b Block b.CurrentProtocol = protoUnsupported @@ -217,7 +217,7 @@ func TestBlockUnsupported(t *testing.T) { } func TestTime(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var prev Block prev.BlockHeader.GenesisID = t.Name() @@ -246,7 +246,7 @@ func TestTime(t *testing.T) { } func TestRewardsLevel(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] var prev Block @@ -260,7 +260,7 @@ func TestRewardsLevel(t *testing.T) { } func TestRewardsLevelWithResidue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] @@ -276,7 +276,7 @@ func TestRewardsLevelWithResidue(t *testing.T) { } func TestRewardsLevelNoUnits(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] @@ -291,7 +291,7 @@ func TestRewardsLevelNoUnits(t *testing.T) { } func TestTinyLevel(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] @@ -305,7 +305,7 @@ func TestTinyLevel(t *testing.T) { } func TestRewardsRate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var prev Block prev.RewardsLevel = 1 @@ -324,7 +324,7 @@ func TestRewardsRate(t *testing.T) { } func TestRewardsRateRefresh(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var prev Block prev.RewardsLevel = 1 @@ -343,7 +343,7 @@ func TestRewardsRateRefresh(t *testing.T) { } func TestEncodeDecodeSignedTxn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var b Block b.BlockHeader.GenesisID = "foo" @@ -362,7 +362,7 @@ func TestEncodeDecodeSignedTxn(t *testing.T) { } func TestEncodeMalformedSignedTxn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var b Block b.BlockHeader.GenesisID = "foo" @@ -387,7 +387,7 @@ func TestEncodeMalformedSignedTxn(t *testing.T) { } func TestDecodeMalformedSignedTxn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var b Block b.BlockHeader.GenesisID = "foo" @@ -408,7 +408,7 @@ func TestDecodeMalformedSignedTxn(t *testing.T) { // TestInitialRewardsRateCalculation perform positive and negative testing for the InitialRewardsRateCalculation fix by // running the rounds in the same way eval() is executing them over RewardsRateRefreshInterval rounds. func TestInitialRewardsRateCalculation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) consensusParams := config.Consensus[protocol.ConsensusCurrentVersion] diff --git a/data/bookkeeping/encoding_test.go b/data/bookkeeping/encoding_test.go index f5eaebcfc8..0c82710f74 100644 --- a/data/bookkeeping/encoding_test.go +++ b/data/bookkeeping/encoding_test.go @@ -24,11 +24,11 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEmptyEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var b Block require.Equal(t, 1, len(protocol.Encode(&b))) @@ -38,7 +38,7 @@ func TestEmptyEncoding(t *testing.T) { } func TestBlockWithTxnEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) txn := transactions.Transaction{ Type: protocol.PaymentTx, diff --git a/data/bookkeeping/msgp_gen_test.go b/data/bookkeeping/msgp_gen_test.go index 654d4b614d..ebae0a774d 100644 --- a/data/bookkeeping/msgp_gen_test.go +++ b/data/bookkeeping/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Block{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalBlock(t *testing.T) { } func TestRandomizedEncodingBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Block{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalBlock(b *testing.B) { } func TestMarshalUnmarshalBlockHeader(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := BlockHeader{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalBlockHeader(t *testing.T) { } func TestRandomizedEncodingBlockHeader(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &BlockHeader{}) } @@ -139,7 +139,7 @@ func BenchmarkUnmarshalBlockHeader(b *testing.B) { } func TestMarshalUnmarshalCompactCertState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := CompactCertState{} bts := v.MarshalMsg(nil) @@ -161,7 +161,7 @@ func TestMarshalUnmarshalCompactCertState(t *testing.T) { } func TestRandomizedEncodingCompactCertState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &CompactCertState{}) } @@ -202,7 +202,7 @@ func BenchmarkUnmarshalCompactCertState(b *testing.B) { } func TestMarshalUnmarshalGenesis(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Genesis{} bts := v.MarshalMsg(nil) @@ -224,7 +224,7 @@ func TestMarshalUnmarshalGenesis(t *testing.T) { } func TestRandomizedEncodingGenesis(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Genesis{}) } @@ -265,7 +265,7 @@ func BenchmarkUnmarshalGenesis(b *testing.B) { } func TestMarshalUnmarshalGenesisAllocation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := GenesisAllocation{} bts := v.MarshalMsg(nil) @@ -287,7 +287,7 @@ func TestMarshalUnmarshalGenesisAllocation(t *testing.T) { } func TestRandomizedEncodingGenesisAllocation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &GenesisAllocation{}) } @@ -328,7 +328,7 @@ func BenchmarkUnmarshalGenesisAllocation(b *testing.B) { } func TestMarshalUnmarshalRewardsState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := RewardsState{} bts := v.MarshalMsg(nil) @@ -350,7 +350,7 @@ func TestMarshalUnmarshalRewardsState(t *testing.T) { } func TestRandomizedEncodingRewardsState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &RewardsState{}) } @@ -391,7 +391,7 @@ func BenchmarkUnmarshalRewardsState(b *testing.B) { } func TestMarshalUnmarshalUpgradeVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := UpgradeVote{} bts := v.MarshalMsg(nil) @@ -413,7 +413,7 @@ func TestMarshalUnmarshalUpgradeVote(t *testing.T) { } func TestRandomizedEncodingUpgradeVote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &UpgradeVote{}) } diff --git a/data/bookkeeping/txn_merkle_test.go b/data/bookkeeping/txn_merkle_test.go index 90ed7444c7..5f7d6b2db4 100644 --- a/data/bookkeeping/txn_merkle_test.go +++ b/data/bookkeeping/txn_merkle_test.go @@ -27,11 +27,11 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTxnMerkleElemHash(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var tme txnMerkleElem crypto.RandBytes(tme.stib.SignedTxn.Txn.Header.Sender[:]) @@ -39,7 +39,7 @@ func TestTxnMerkleElemHash(t *testing.T) { } func TestTxnMerkle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for ntxn := uint64(0); ntxn < 128; ntxn++ { var b Block diff --git a/data/committee/credential_test.go b/data/committee/credential_test.go index 84c4154d1b..2132a8d1f9 100644 --- a/data/committee/credential_test.go +++ b/data/committee/credential_test.go @@ -23,13 +23,13 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // test SelfCheckSelected (should always be true, with current testingenv parameters) // and then set balance to 0 and test not SelfCheckSelected func TestAccountSelected(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) N := 1 for i := 0; i < N; i++ { @@ -89,7 +89,7 @@ func TestAccountSelected(t *testing.T) { } func TestRichAccountSelected(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) selParams, _, round, addresses, _, vrfSecrets, _, _ := testingenv(t, 10, 2000) @@ -142,7 +142,7 @@ func TestRichAccountSelected(t *testing.T) { } func TestPoorAccountSelectedLeaders(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) N := 2 failsLeaders := 0 @@ -187,7 +187,7 @@ func TestPoorAccountSelectedLeaders(t *testing.T) { } func TestPoorAccountSelectedCommittee(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) N := 1 committee := uint64(0) @@ -227,7 +227,7 @@ func TestPoorAccountSelectedCommittee(t *testing.T) { } func TestNoMoneyAccountNotSelected(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) N := 1 for i := 0; i < N; i++ { @@ -260,7 +260,7 @@ func TestNoMoneyAccountNotSelected(t *testing.T) { } func TestLeadersSelected(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) selParams, _, round, addresses, _, vrfSecrets, _, _ := testingenv(t, 100, 2000) @@ -292,7 +292,7 @@ func TestLeadersSelected(t *testing.T) { } func TestCommitteeSelected(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) selParams, _, round, addresses, _, vrfSecrets, _, _ := testingenv(t, 100, 2000) @@ -324,7 +324,7 @@ func TestCommitteeSelected(t *testing.T) { } func TestAccountNotSelected(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) selParams, _, round, addresses, _, vrfSecrets, _, _ := testingenv(t, 100, 2000) period := Period(0) diff --git a/data/committee/encoding_test.go b/data/committee/encoding_test.go index dfdac2bc3c..f9491dbbf8 100644 --- a/data/committee/encoding_test.go +++ b/data/committee/encoding_test.go @@ -22,11 +22,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEmptyEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var c Credential require.Equal(t, 1, len(protocol.Encode(&c))) diff --git a/data/committee/msgp_gen_test.go b/data/committee/msgp_gen_test.go index 3854dd2b14..d18ec302d4 100644 --- a/data/committee/msgp_gen_test.go +++ b/data/committee/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalCredential(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Credential{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalCredential(t *testing.T) { } func TestRandomizedEncodingCredential(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Credential{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalCredential(b *testing.B) { } func TestMarshalUnmarshalSeed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Seed{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalSeed(t *testing.T) { } func TestRandomizedEncodingSeed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Seed{}) } @@ -139,7 +139,7 @@ func BenchmarkUnmarshalSeed(b *testing.B) { } func TestMarshalUnmarshalUnauthenticatedCredential(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := UnauthenticatedCredential{} bts := v.MarshalMsg(nil) @@ -161,7 +161,7 @@ func TestMarshalUnmarshalUnauthenticatedCredential(t *testing.T) { } func TestRandomizedEncodingUnauthenticatedCredential(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &UnauthenticatedCredential{}) } @@ -202,7 +202,7 @@ func BenchmarkUnmarshalUnauthenticatedCredential(b *testing.B) { } func TestMarshalUnmarshalhashableCredential(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := hashableCredential{} bts := v.MarshalMsg(nil) @@ -224,7 +224,7 @@ func TestMarshalUnmarshalhashableCredential(t *testing.T) { } func TestRandomizedEncodinghashableCredential(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &hashableCredential{}) } diff --git a/data/hashable/msgp_gen_test.go b/data/hashable/msgp_gen_test.go index c844c3ca91..620992dbcd 100644 --- a/data/hashable/msgp_gen_test.go +++ b/data/hashable/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalMessage(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Message{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalMessage(t *testing.T) { } func TestRandomizedEncodingMessage(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Message{}) } diff --git a/data/ledger_test.go b/data/ledger_test.go index 35037d929c..e2a2318027 100644 --- a/data/ledger_test.go +++ b/data/ledger_test.go @@ -31,7 +31,7 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var testPoolAddr = basics.Address{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} @@ -113,7 +113,7 @@ func testGenerateInitState(tb testing.TB, proto protocol.ConsensusVersion) (gene } func TestLedgerCirculation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) genesisInitState, keys := testGenerateInitState(t, protocol.ConsensusCurrentVersion) @@ -246,7 +246,7 @@ func TestLedgerCirculation(t *testing.T) { } func TestLedgerSeed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) genesisInitState, _ := testGenerateInitState(t, protocol.ConsensusCurrentVersion) @@ -320,7 +320,7 @@ func TestLedgerSeed(t *testing.T) { } func TestConsensusVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // find a consensus protocol that leads to ConsensusCurrentVersion var previousProtocol protocol.ConsensusVersion diff --git a/data/pools/transactionPool_test.go b/data/pools/transactionPool_test.go index 9805e509a6..59d81e8887 100644 --- a/data/pools/transactionPool_test.go +++ b/data/pools/transactionPool_test.go @@ -35,7 +35,7 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var proto = config.Consensus[protocol.ConsensusCurrentVersion] @@ -136,7 +136,7 @@ func initAccFixed(initAddrs []basics.Address, bal uint64) map[basics.Address]bas const testPoolSize = 1000 func TestMinBalanceOK(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -179,7 +179,7 @@ func TestMinBalanceOK(t *testing.T) { } func TestSenderGoesBelowMinBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -222,7 +222,7 @@ func TestSenderGoesBelowMinBalance(t *testing.T) { } func TestSenderGoesBelowMinBalanceDueToAssets(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -294,7 +294,7 @@ func TestSenderGoesBelowMinBalanceDueToAssets(t *testing.T) { } func TestCloseAccount(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -357,7 +357,7 @@ func TestCloseAccount(t *testing.T) { } func TestCloseAccountWhileTxIsPending(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -420,7 +420,7 @@ func TestCloseAccountWhileTxIsPending(t *testing.T) { } func TestClosingAccountBelowMinBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -465,7 +465,7 @@ func TestClosingAccountBelowMinBalance(t *testing.T) { } func TestRecipientGoesBelowMinBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -508,7 +508,7 @@ func TestRecipientGoesBelowMinBalance(t *testing.T) { } func TestRememberForget(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -575,7 +575,7 @@ func TestRememberForget(t *testing.T) { // Test that clean up works func TestCleanUp(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 10 // Generate accounts @@ -654,7 +654,7 @@ func TestCleanUp(t *testing.T) { } func TestFixOverflowOnNewBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 10 // Generate accounts @@ -750,7 +750,7 @@ func TestFixOverflowOnNewBlock(t *testing.T) { } func TestOverspender(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 2 // Generate accounts @@ -813,7 +813,7 @@ func TestOverspender(t *testing.T) { } func TestRemove(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 2 // Generate accounts @@ -856,7 +856,7 @@ func TestRemove(t *testing.T) { } func TestLogicSigOK(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) oparams := config.Consensus[protocol.ConsensusCurrentVersion] params := oparams @@ -916,7 +916,7 @@ func TestLogicSigOK(t *testing.T) { } func TestTransactionPool_CurrentFeePerByte(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 5 // Generate accounts @@ -1187,7 +1187,7 @@ func BenchmarkTransactionPoolSteadyState(b *testing.B) { } func TestTxPoolSizeLimits(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numOfAccounts := 2 // Generate accounts diff --git a/data/transactions/application_test.go b/data/transactions/application_test.go index a94c2a40e3..78670bf18a 100644 --- a/data/transactions/application_test.go +++ b/data/transactions/application_test.go @@ -24,11 +24,11 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestApplicationCallFieldsNotChanged(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) af := ApplicationCallTxnFields{} s := reflect.ValueOf(&af).Elem() @@ -41,7 +41,7 @@ func TestApplicationCallFieldsNotChanged(t *testing.T) { } func TestApplicationCallFieldsEmpty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -98,7 +98,7 @@ func TestApplicationCallFieldsEmpty(t *testing.T) { } func TestEncodedAppTxnAllocationBounds(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // ensure that all the supported protocols have value limits less or // equal to their corresponding codec allocbounds diff --git a/data/transactions/logic/assembler_test.go b/data/transactions/logic/assembler_test.go index 9340e7230d..cdc2b3747b 100644 --- a/data/transactions/logic/assembler_test.go +++ b/data/transactions/logic/assembler_test.go @@ -23,7 +23,7 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -335,7 +335,7 @@ func pseudoOp(opcode string) bool { // Check that assembly output is stable across time. func TestAssemble(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // UPDATE PROCEDURE: // Run test. It should pass. If test is not passing, do not change this test, fix the assembler first. @@ -375,7 +375,7 @@ func TestAssemble(t *testing.T) { } func TestAssembleAlias(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source1 := `txn Accounts 0 // alias to txna @@ -469,7 +469,7 @@ func testLine(t *testing.T, line string, ver uint64, expected string) { testProg(t, source, ver, expect{2, expected}) } func TestAssembleTxna(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLine(t, "txna Accounts 256", AssemblerMaxVersion, "txna array index beyond 255: 256") testLine(t, "txna ApplicationArgs 256", AssemblerMaxVersion, "txna array index beyond 255: 256") @@ -499,14 +499,14 @@ func TestAssembleTxna(t *testing.T) { } func TestAssembleGlobal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLine(t, "global", AssemblerMaxVersion, "global expects one argument") testLine(t, "global a", AssemblerMaxVersion, "global unknown field: \"a\"") } func TestAssembleDefault(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) source := `byte 0x1122334455 int 1 @@ -522,7 +522,7 @@ func mutateProgVersion(version uint64, prog string) string { } func TestOpUint(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for v := uint64(1); v <= AssemblerMaxVersion; v++ { t.Run(fmt.Sprintf("v=%d", v), func(t *testing.T) { @@ -538,7 +538,7 @@ func TestOpUint(t *testing.T) { } func TestOpUint64(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -555,7 +555,7 @@ func TestOpUint64(t *testing.T) { } func TestOpBytes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -571,7 +571,7 @@ func TestOpBytes(t *testing.T) { } func TestAssembleInt(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -605,7 +605,7 @@ base64.b16encode(raw.encode()) */ func TestAssembleBytes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() variations := []string{ @@ -648,7 +648,7 @@ func TestAssembleBytes(t *testing.T) { } func TestAssembleBytesString(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for v := uint64(1); v <= AssemblerMaxVersion; v++ { t.Run(fmt.Sprintf("v=%d", v), func(t *testing.T) { @@ -659,7 +659,7 @@ func TestAssembleBytesString(t *testing.T) { } func TestAssembleOptimizedConstants(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -868,7 +868,7 @@ bytec_1 // 0x0103 } func TestAssembleOptimizedUint(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -893,7 +893,7 @@ int ClearState } func TestFieldsFromLine(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) line := "op arg" fields := fieldsFromLine(line) @@ -1101,7 +1101,7 @@ func TestFieldsFromLine(t *testing.T) { } func TestAssembleRejectNegJump(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := `wat: @@ -1121,7 +1121,7 @@ int 2` } func TestAssembleBase64(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() text := `byte base64 //GWRM+yy3BCavBDXO/FYTNZ6o2Jai5edsMCBdDEz+0= @@ -1156,7 +1156,7 @@ byte b64 avGWRM+yy3BCavBDXO/FYTNZ6o2Jai5edsMCBdDEz//= } func TestAssembleRejectUnkLabel(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := `int 1 @@ -1170,7 +1170,7 @@ int 2` } func TestAssembleJumpToTheEnd(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := `intcblock 1 @@ -1187,7 +1187,7 @@ done:` } func TestMultipleErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := `int 1 @@ -1205,7 +1205,7 @@ int 2` } func TestAssembleDisassemble(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Specifically constructed program text that should be recreated by Disassemble() t.Parallel() @@ -1321,7 +1321,7 @@ txn ExtraProgramPages } func TestAssembleDisassembleCycle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Test that disassembly re-assembles to the same program bytes. // Disassembly won't necessarily perfectly recreate the source text, but assembling the result of Disassemble() should be the same program bytes. @@ -1356,7 +1356,7 @@ func TestAssembleDisassembleCycle(t *testing.T) { } func TestConstantDisassembly(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1388,7 +1388,7 @@ func TestConstantDisassembly(t *testing.T) { } func TestAssembleDisassembleErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1501,7 +1501,7 @@ func TestAssembleDisassembleErrors(t *testing.T) { } func TestAssembleVersions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testLine(t, "txna Accounts 0", AssemblerMaxVersion, "") @@ -1510,7 +1510,7 @@ func TestAssembleVersions(t *testing.T) { } func TestAssembleBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1527,7 +1527,7 @@ int 1 } func TestAssembleMinBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1544,7 +1544,7 @@ int 1 } func TestAssembleAsset(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() introduction := OpsByName[LogicVersion]["asset_holding_get"].Version @@ -1567,7 +1567,7 @@ func TestAssembleAsset(t *testing.T) { } func TestDisassembleSingleOp(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1584,7 +1584,7 @@ func TestDisassembleSingleOp(t *testing.T) { } func TestDisassembleInt(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() txnSample := fmt.Sprintf("#pragma version %d\nint 17\nint 27\nint 37\nint 47\nint 5\nint 17\n", AssemblerMaxVersion) @@ -1602,7 +1602,7 @@ func TestDisassembleInt(t *testing.T) { } func TestDisassembleTxna(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() // txn was 1, but this tests both @@ -1631,7 +1631,7 @@ func TestDisassembleTxna(t *testing.T) { } func TestDisassembleGtxna(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() // check gtxn and gtxna are properly disassembled @@ -1660,7 +1660,7 @@ func TestDisassembleGtxna(t *testing.T) { } func TestDisassemblePushConst(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() // check pushint and pushbytes are properly disassembled @@ -1690,7 +1690,7 @@ func TestDisassemblePushConst(t *testing.T) { } func TestDisassembleLastLabel(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1713,7 +1713,7 @@ label1: } func TestAssembleOffsets(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := "err" @@ -1813,7 +1813,7 @@ err } func TestHasStatefulOps(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := "int 1" @@ -1836,7 +1836,7 @@ err } func TestStringLiteralParsing(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() s := `"test"` @@ -1933,7 +1933,7 @@ func TestStringLiteralParsing(t *testing.T) { } func TestPragmas(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -1998,7 +1998,7 @@ func TestPragmas(t *testing.T) { } func TestAssemblePragmaVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() text := `#pragma version 1 @@ -2052,7 +2052,7 @@ len } func TestAssembleConstants(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2067,7 +2067,7 @@ func TestAssembleConstants(t *testing.T) { } func TestErrShortBytecblock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) text := `intcblock 0x1234567812345678 0x1234567812345671 0x1234567812345672 0x1234567812345673 4 5 6 7 8` ops, err := AssembleStringWithVersion(text, 1) @@ -2082,7 +2082,7 @@ func TestErrShortBytecblock(t *testing.T) { } func TestBranchAssemblyTypeCheck(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) text := ` int 0 // current app id [0] diff --git a/data/transactions/logic/backwardCompat_test.go b/data/transactions/logic/backwardCompat_test.go index a42703000a..68dcf73bc0 100644 --- a/data/transactions/logic/backwardCompat_test.go +++ b/data/transactions/logic/backwardCompat_test.go @@ -26,7 +26,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -251,7 +251,7 @@ dup var programTEALv1 = "01200500010220ffffffffffffffffff012608014120559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd0142201f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a6911101432034b99f8dde1ba273c0a28cf5b2e4dbe497f8cb2453de0c8ba6d578c9431a62cb0100200000000000000000000000000000000000000000000000000000000000000000280129122a022b1210270403270512102d2e2f041022082209230a230b240c220d230e230f231022112312231314301525121617182319231a221b21041c1d12222312242512102104231210482829122a2b121027042706121048310031071331013102121022310413103105310613103108311613103109310a1210310b310f1310310c310d1210310e31101310311131121310311331141210311531171210483300003300071333000133000212102233000413103300053300061310330008330016131033000933000a121033000b33000f131033000c33000d121033000e3300101310330011330012131033001333001412103300153300171210483200320112320232041310320327071210350034001040000100234912" func TestBackwardCompatTEALv1(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() var s crypto.Seed @@ -376,7 +376,7 @@ func TestBackwardCompatTEALv1(t *testing.T) { // ensure v2 fields error on pre TEAL v2 logicsig version // ensure v2 fields error in v1 program func TestBackwardCompatGlobalFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() var fields []globalFieldSpec @@ -434,7 +434,7 @@ func TestBackwardCompatGlobalFields(t *testing.T) { // ensure v2 fields error in v1 program func TestBackwardCompatTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() var fields []txnFieldSpec @@ -519,7 +519,7 @@ func TestBackwardCompatTxnFields(t *testing.T) { } func TestBackwardCompatAssemble(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // TEAL v1 does not allow branching to the last line // TEAL v2 makes such programs legal diff --git a/data/transactions/logic/debugger_test.go b/data/transactions/logic/debugger_test.go index 12362ab427..a9c0603dcb 100644 --- a/data/transactions/logic/debugger_test.go +++ b/data/transactions/logic/debugger_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -64,7 +64,7 @@ bytec 4 ` func TestWebDebuggerManual(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) debugURL := os.Getenv("TEAL_DEBUGGER_URL") if len(debugURL) == 0 { @@ -117,7 +117,7 @@ func (d *testDbgHook) Complete(state *DebugState) error { } func TestDebuggerHook(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testDbg := testDbgHook{} ops, err := AssembleString(testProgram) @@ -134,7 +134,7 @@ func TestDebuggerHook(t *testing.T) { } func TestLineToPC(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dState := DebugState{ Disassembly: "abc\ndef\nghi", @@ -171,7 +171,7 @@ func TestLineToPC(t *testing.T) { } func TestValueDeltaToValueDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) vDelta := basics.ValueDelta{ Action: basics.SetUintAction, diff --git a/data/transactions/logic/doc_test.go b/data/transactions/logic/doc_test.go index f53853113f..ad87f4a010 100644 --- a/data/transactions/logic/doc_test.go +++ b/data/transactions/logic/doc_test.go @@ -20,12 +20,12 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestOpDocs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) opsSeen := make(map[string]bool, len(OpSpecs)) for _, op := range OpSpecs { @@ -54,7 +54,7 @@ func TestOpDocs(t *testing.T) { } func TestOpGroupCoverage(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) opsSeen := make(map[string]bool, len(OpSpecs)) for _, op := range OpSpecs { @@ -78,7 +78,7 @@ func TestOpGroupCoverage(t *testing.T) { } func TestOpDoc(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) xd := OpDoc("txn") require.NotEmpty(t, xd) @@ -87,7 +87,7 @@ func TestOpDoc(t *testing.T) { } func TestOpImmediateNote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) xd := OpImmediateNote("txn") require.NotEmpty(t, xd) @@ -109,7 +109,7 @@ func TestAllImmediatesDocumented(t *testing.T) { } func TestOpDocExtra(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) xd := OpDocExtra("bnz") require.NotEmpty(t, xd) @@ -118,7 +118,7 @@ func TestOpDocExtra(t *testing.T) { } func TestOpAllCosts(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := OpAllCosts("+") require.Len(t, a, 1) @@ -132,7 +132,7 @@ func TestOpAllCosts(t *testing.T) { } func TestOnCompletionDescription(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) desc := OnCompletionDescription(0) require.Equal(t, "Only execute the `ApprovalProgram` associated with this application ID, with no additional effects.", desc) @@ -142,7 +142,7 @@ func TestOnCompletionDescription(t *testing.T) { } func TestFieldDocs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) txnFields := TxnFieldDocs() require.Greater(t, len(txnFields), 0) diff --git a/data/transactions/logic/evalStateful_test.go b/data/transactions/logic/evalStateful_test.go index 9ebdf818a0..b414132cdb 100644 --- a/data/transactions/logic/evalStateful_test.go +++ b/data/transactions/logic/evalStateful_test.go @@ -29,7 +29,7 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type balanceRecord struct { @@ -468,7 +468,7 @@ func (l *testLedger) GetDelta(txn *transactions.Transaction) (evalDelta basics.E } func TestEvalModes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() // ed25519verify and err are tested separately below @@ -731,7 +731,7 @@ pop } func TestBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -798,7 +798,7 @@ func testApp(t *testing.T, program string, ep EvalParams, problems ...string) ba } func TestMinBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -838,7 +838,7 @@ func TestMinBalance(t *testing.T) { } func TestAppCheckOptedIn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -885,7 +885,7 @@ func TestAppCheckOptedIn(t *testing.T) { } func TestAppReadLocalState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1034,7 +1034,7 @@ int 0 } func TestAppReadGlobalState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1241,7 +1241,7 @@ int 1 ` func TestAssets(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for _, field := range AssetHoldingFieldNames { @@ -1443,7 +1443,7 @@ func TestAppParams(t *testing.T) { } func TestAppLocalReadWriteDeleteErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1562,7 +1562,7 @@ intc_1 } func TestAppLocalStateReadWrite(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1839,7 +1839,7 @@ int 1 } func TestAppGlobalReadWriteDeleteErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1920,7 +1920,7 @@ int 1 } func TestAppGlobalReadWrite(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -2139,7 +2139,7 @@ byte 0x414c474f } func TestAppGlobalReadOtherApp(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := `int 2 // ForeignApps index @@ -2186,7 +2186,7 @@ byte "myval" } func TestBlankKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := ` @@ -2222,7 +2222,7 @@ int 7 } func TestAppGlobalDelete(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -2381,7 +2381,7 @@ int 1 } func TestAppLocalDelete(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -2595,7 +2595,7 @@ int 1 } func TestEnumFieldErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ep := defaultEvalParams(nil, nil) @@ -2689,7 +2689,7 @@ pop } func TestReturnTypes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Ensure all opcodes return values they supposed to according to the OpSpecs table t.Parallel() @@ -2825,7 +2825,7 @@ func TestReturnTypes(t *testing.T) { } func TestRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() ep, _ := makeSampleEnv() source := "global Round; int 1; >=" @@ -2833,7 +2833,7 @@ func TestRound(t *testing.T) { } func TestLatestTimestamp(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() ep, _ := makeSampleEnv() source := "global LatestTimestamp; int 1; >=" @@ -2841,7 +2841,7 @@ func TestLatestTimestamp(t *testing.T) { } func TestCurrentApplicationID(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() ep, ledger := makeSampleEnv() ledger.appID = basics.AppIndex(42) @@ -2850,7 +2850,7 @@ func TestCurrentApplicationID(t *testing.T) { } func TestAppLoop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() ep, _ := makeSampleEnv() diff --git a/data/transactions/logic/eval_test.go b/data/transactions/logic/eval_test.go index e9d9d9f35e..64e31d1927 100644 --- a/data/transactions/logic/eval_test.go +++ b/data/transactions/logic/eval_test.go @@ -35,7 +35,7 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // Note that most of the tests use defaultEvalProto/defaultEvalParams as evaluator version so that @@ -102,7 +102,7 @@ func defaultEvalParamsWithVersion(sb *strings.Builder, txn *transactions.SignedT } func TestTooManyArgs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -121,7 +121,7 @@ func TestTooManyArgs(t *testing.T) { } func TestEmptyProgram(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() pass, err := Eval(nil, defaultEvalParams(nil, nil)) @@ -132,7 +132,7 @@ func TestEmptyProgram(t *testing.T) { // TestMinTealVersionParamEval tests eval/check reading the MinTealVersion from the param func TestMinTealVersionParamEvalCheck(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() params := defaultEvalParams(nil, nil) @@ -153,7 +153,7 @@ func TestMinTealVersionParamEvalCheck(t *testing.T) { } func TestTxnFieldToTealValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) txn := transactions.Transaction{} groupIndex := 0 @@ -200,7 +200,7 @@ func TestTxnFieldToTealValue(t *testing.T) { } func TestWrongProtoVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -225,7 +225,7 @@ func TestWrongProtoVersion(t *testing.T) { } func TestSimpleMath(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 2; int 3; + ;int 5;==", 1) @@ -237,7 +237,7 @@ func TestSimpleMath(t *testing.T) { } func TestSha256EqArg(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -295,7 +295,7 @@ int 1000000 &&` func TestTLHC(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -382,21 +382,21 @@ func TestTLHC(t *testing.T) { } func TestU64Math(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 0x1234567812345678; int 0x100000000; /; int 0x12345678; ==", 1) } func TestItob(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "byte 0x1234567812345678; int 0x1234567812345678; itob; ==", 1) } func TestBtoi(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 0x1234567812345678; byte 0x1234567812345678; btoi; ==", 1) @@ -409,14 +409,14 @@ func TestBtoi(t *testing.T) { } func TestBtoiTooLong(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 0x1234567812345678; byte 0x1234567812345678aa; btoi; ==", 1) } func TestBnz(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, ` @@ -448,7 +448,7 @@ pop } func TestV2Branches(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, ` @@ -470,7 +470,7 @@ int 1 } func TestReturn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 1; return; err", 2) @@ -478,28 +478,28 @@ func TestReturn(t *testing.T) { } func TestSubUnderflow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 1; int 10; -; pop; int 1", 1) } func TestAddOverflow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 0xf000000000000000; int 0x1111111111111111; +; pop; int 1", 1) } func TestMulOverflow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 0x111111111; int 0x222222222; *; pop; int 1", 1) } func TestMulwImpl(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() high, low, err := opMulwImpl(1, 2) @@ -524,7 +524,7 @@ func TestMulwImpl(t *testing.T) { } func TestMulw(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, ` @@ -546,7 +546,7 @@ int 1 // ret 1 } func TestAddwImpl(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() carry, sum := opAddwImpl(1, 2) @@ -567,7 +567,7 @@ func TestAddwImpl(t *testing.T) { } func TestAddw(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, ` @@ -589,7 +589,7 @@ int 1 // ret 1 } func TestUint128(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) x := uint128(0, 3) require.Equal(t, x.String(), "3") @@ -604,7 +604,7 @@ func TestUint128(t *testing.T) { } func TestDivModw(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() // 2:0 / 1:0 == 2r0 == 0:2,0:0 @@ -649,7 +649,7 @@ func TestDivModw(t *testing.T) { } func TestWideMath(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // 2^64 = 18446744073709551616, we use a bunch of numbers close to that below pattern := ` @@ -695,70 +695,70 @@ int 1 } func TestDivZero(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 0x11; int 0; /; pop; int 1", 1) } func TestModZero(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 0x111111111; int 0; %; pop; int 1", 1) } func TestErr(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "err; int 1", 1) } func TestModSubMulOk(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 35; int 16; %; int 1; -; int 2; *; int 4; ==", 1) } func TestPop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 1; int 0; pop", 1) } func TestStackLeftover(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 1; int 1", 1) } func TestStackBytesLeftover(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "byte 0x10101010", 1) } func TestStackEmpty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 1; int 1; pop; pop", 1) } func TestArgTooFar(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "arg_1; btoi", 1) } func TestIntcTooFar(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() // Want to be super clear that intc_1 fails, whether an intcblock exists (but small) or not @@ -767,7 +767,7 @@ func TestIntcTooFar(t *testing.T) { } func TestBytecTooFar(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "bytec_1; btoi", 1) @@ -775,7 +775,7 @@ func TestBytecTooFar(t *testing.T) { } func TestTxnBadField(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() program := []byte{0x01, 0x31, 0x7f} @@ -812,7 +812,7 @@ func TestTxnBadField(t *testing.T) { } func TestGtxnBadIndex(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() program := []byte{0x01, 0x33, 0x1, 0x01} @@ -837,7 +837,7 @@ func TestGtxnBadIndex(t *testing.T) { } func TestGtxnBadField(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() program := []byte{0x01, 0x33, 0x0, 0x7f} @@ -878,7 +878,7 @@ func TestGtxnBadField(t *testing.T) { } func TestGlobalBadField(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() program := []byte{0x01, 0x32, 0x7f} @@ -899,7 +899,7 @@ func TestGlobalBadField(t *testing.T) { } func TestArg(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -997,7 +997,7 @@ const globalV5TestProgram = globalV4TestProgram + ` ` func TestGlobal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() type desc struct { @@ -1079,7 +1079,7 @@ func TestGlobal(t *testing.T) { } func TestTypeEnum(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -1135,7 +1135,7 @@ int %s } func TestOnCompletionConstants(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -1498,7 +1498,7 @@ func makeSampleTxnGroup(txn transactions.SignedTxn) []transactions.SignedTxn { } func TestTxn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for _, txnField := range TxnFieldNames { @@ -1564,7 +1564,7 @@ func TestTxn(t *testing.T) { } func TestCachedTxIDs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() cachedTxnProg := ` @@ -1637,7 +1637,7 @@ return } func TestGaid(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() checkCreatableIDProg := ` @@ -1706,7 +1706,7 @@ int 0 } func TestGtxn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() gtxnTextV1 := `gtxn 1 Amount @@ -1851,7 +1851,7 @@ func testLogic(t *testing.T, program string, v uint64, ep EvalParams, problems . } func TestTxna(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := `txna Accounts 1 @@ -1974,7 +1974,7 @@ txn Sender // check empty values in ApplicationArgs and Account func TestTxnaEmptyValues(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := `txna ApplicationArgs 0 @@ -2026,7 +2026,7 @@ global ZeroAddress } func TestBitOps(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, `int 0x17 @@ -2044,7 +2044,7 @@ int 0x310 } func TestStringOps(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, `byte 0x123456789abc @@ -2077,7 +2077,7 @@ int 0 } func TestConsOverflow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() justfits := `byte 0xf000000000000000 @@ -2096,7 +2096,7 @@ dup; concat // 4096 } func TestSubstringFlop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() // fails in compiler @@ -2131,7 +2131,7 @@ len`, 2) } func TestSubstringRange(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, `byte 0xf000000000000000 @@ -2208,7 +2208,7 @@ func TestExtractFlop(t *testing.T) { } func TestLoadStore(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, `int 37 @@ -2229,7 +2229,7 @@ load 1 } func TestLoadStore2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() progText := `int 2 @@ -2247,7 +2247,7 @@ int 5 } func TestGload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -2447,7 +2447,7 @@ int 1`, } func TestGloads(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -2573,14 +2573,14 @@ byte 0xf00d &&` func TestCompares(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, testCompareProgramText, 1) } func TestKeccak256(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() /* @@ -2597,7 +2597,7 @@ byte 0xc195eca25a6f4c82bfba0287082ddb0d602ae9230f9cf1f1a40b68f8e2c41567 } func TestSHA512_256(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() /* @@ -2618,7 +2618,7 @@ byte 0x98D2C31612EA500279B6753E5F6E780CA63EBA8274049664DAD66A2565ED1D2A } func TestSlowLogic(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() fragment := `byte 0x666E6F7264; keccak256 @@ -2676,7 +2676,7 @@ func isNotPanic(t *testing.T, err error) { } func TestStackUnderflow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2699,7 +2699,7 @@ func TestStackUnderflow(t *testing.T) { } func TestWrongStackTypeRuntime(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2722,7 +2722,7 @@ func TestWrongStackTypeRuntime(t *testing.T) { } func TestEqMismatch(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2746,7 +2746,7 @@ int 1`, v) } func TestNeqMismatch(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2770,7 +2770,7 @@ int 1`, v) } func TestWrongStackTypeRuntime2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2794,7 +2794,7 @@ int 1`, v) } func TestIllegalOp(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2822,7 +2822,7 @@ func TestIllegalOp(t *testing.T) { } func TestShortProgram(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2850,7 +2850,7 @@ int 1 } func TestShortProgramTrue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() ops := testProg(t, `intcblock 1 @@ -2866,7 +2866,7 @@ done:`, 2) require.True(t, pass) } func TestShortBytecblock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2895,7 +2895,7 @@ func TestShortBytecblock(t *testing.T) { } func TestShortBytecblock2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() sources := []string{ @@ -2933,7 +2933,7 @@ func checkPanic(cx *evalContext) error { } func TestPanic(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) log := logging.TestingLog(t) for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -2989,7 +2989,7 @@ func TestPanic(t *testing.T) { } func TestProgramTooNew(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() var program [12]byte @@ -3004,7 +3004,7 @@ func TestProgramTooNew(t *testing.T) { } func TestInvalidVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() program, err := hex.DecodeString("ffffffffffffffffffffffff") @@ -3019,7 +3019,7 @@ func TestInvalidVersion(t *testing.T) { } func TestProgramProtoForbidden(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() var program [12]byte @@ -3039,7 +3039,7 @@ func TestProgramProtoForbidden(t *testing.T) { } func TestMisalignedBranch(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -3084,7 +3084,7 @@ int 1`, v) } func TestBranchTooFar(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -3113,7 +3113,7 @@ int 1`, v) } func TestBranchTooLarge(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { @@ -3641,7 +3641,7 @@ func BenchmarkSha256Raw(b *testing.B) { } func TestEd25519verify(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() var s crypto.Seed @@ -3774,7 +3774,7 @@ func BenchmarkCheckx5(b *testing.B) { } func TestStackValues(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -3792,7 +3792,7 @@ func TestStackValues(t *testing.T) { } func TestEvalVersions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -3823,7 +3823,7 @@ pop } func TestStackOverflow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() source := "int 1; int 2;" @@ -3835,7 +3835,7 @@ func TestStackOverflow(t *testing.T) { } func TestDup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -3872,7 +3872,7 @@ int 1 } func TestStringLiteral(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -3902,7 +3902,7 @@ byte 0x // empty byte constant } func TestArgType(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -3917,7 +3917,7 @@ func TestArgType(t *testing.T) { } func TestApplicationsDisallowOldTeal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const source = "int 1" ep := defaultEvalParams(nil, nil) @@ -3952,7 +3952,7 @@ func TestApplicationsDisallowOldTeal(t *testing.T) { } func TestAnyRekeyToOrApplicationRaisesMinTealVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const source = "int 1" @@ -4046,7 +4046,7 @@ func TestAnyRekeyToOrApplicationRaisesMinTealVersion(t *testing.T) { // check all v2 opcodes: allowed in v2 and not allowed in v1 and v0 func TestAllowedOpcodesV2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -4125,7 +4125,7 @@ func TestAllowedOpcodesV2(t *testing.T) { // check all v3 opcodes: allowed in v3 and not allowed before func TestAllowedOpcodesV3(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -4186,7 +4186,7 @@ func TestAllowedOpcodesV3(t *testing.T) { } func TestRekeyFailsOnOldVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(0); v < rekeyingEnabledVersion; v++ { @@ -4288,7 +4288,7 @@ func testPanics(t *testing.T, program string, introduced uint64) error { } func TestAssert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 1;assert;int 1", 3) @@ -4299,7 +4299,7 @@ func TestAssert(t *testing.T) { } func TestBits(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 1; int 0; getbit; int 1; ==", 3) @@ -4337,7 +4337,7 @@ func TestBits(t *testing.T) { } func TestBytes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "byte 0x12345678; int 2; getbyte; int 0x56; ==", 3) @@ -4371,7 +4371,7 @@ func TestMethod(t *testing.T) { } func TestSwap(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 1; byte 0x1234; swap; int 1; ==; assert; byte 0x1234; ==", 3) @@ -4379,7 +4379,7 @@ func TestSwap(t *testing.T) { } func TestSelect(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -4391,7 +4391,7 @@ func TestSelect(t *testing.T) { } func TestDig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 3; int 2; int 1; dig 1; int 2; ==; return", 3) @@ -4399,7 +4399,7 @@ func TestDig(t *testing.T) { } func TestPush(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 2; pushint 2; ==", 3) @@ -4428,7 +4428,7 @@ func TestPush(t *testing.T) { } func TestLoop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() // Double until > 10. Should be 16 @@ -4441,7 +4441,7 @@ func TestLoop(t *testing.T) { } func TestSubroutine(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 1; callsub double; int 2; ==; return; double: dup; +; retsub;", 4) @@ -4525,7 +4525,7 @@ main: } func TestShifts(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 1; int 1; shl; int 2; ==", 4) @@ -4542,7 +4542,7 @@ func TestShifts(t *testing.T) { } func TestSqrt(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 0; sqrt; int 0; ==", 4) @@ -4568,7 +4568,7 @@ func TestSqrt(t *testing.T) { } func TestExp(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 0; int 0; exp; int 1; ==", 4) @@ -4581,7 +4581,7 @@ func TestExp(t *testing.T) { } func TestExpw(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testPanics(t, "int 0; int 0; expw; int 1; ==; assert; int 0; ==", 4) @@ -4597,7 +4597,7 @@ func TestExpw(t *testing.T) { } func TestBitLen(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 0; bitlen; int 0; ==", 4) @@ -4620,7 +4620,7 @@ func TestBitLen(t *testing.T) { } func TestBytesMath(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "byte 0x01; byte 0x01; b+; byte 0x02; ==", 4) @@ -4650,7 +4650,7 @@ func TestBytesMath(t *testing.T) { } func TestBytesCompare(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "byte 0x10; byte 0x10; b*; byte 0x0100; ==", 4) @@ -4675,7 +4675,7 @@ func TestBytesCompare(t *testing.T) { } func TestBytesBits(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "byte 0x11; byte 0x10; b|; byte 0x11; ==", 4) @@ -4702,7 +4702,7 @@ func TestBytesBits(t *testing.T) { } func TestBytesConversions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testAccepts(t, "byte 0x11; byte 0x10; b+; btoi; int 0x21; ==", 4) testAccepts(t, "byte 0x0011; byte 0x10; b+; btoi; int 0x21; ==", 4) diff --git a/data/transactions/logic/opcodes_test.go b/data/transactions/logic/opcodes_test.go index 4cd655285f..c894e12478 100644 --- a/data/transactions/logic/opcodes_test.go +++ b/data/transactions/logic/opcodes_test.go @@ -21,12 +21,12 @@ import ( "reflect" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestOpSpecs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -59,7 +59,7 @@ func (os *OpSpec) equals(oso *OpSpec) bool { } func TestOpcodesByVersionReordered(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make a copy to restore to the original OpSpecsOrig := make([]OpSpec, len(OpSpecs)) @@ -81,7 +81,7 @@ func TestOpcodesByVersionReordered(t *testing.T) { } func TestOpcodesByVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Make a copy of the OpSpecs to check if OpcodesByVersion will change it OpSpecs2 := make([]OpSpec, len(OpSpecs)) @@ -121,7 +121,7 @@ func TestOpcodesByVersion(t *testing.T) { } func TestOpcodesVersioningV2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() diff --git a/data/transactions/msgp_gen_test.go b/data/transactions/msgp_gen_test.go index 0938971ca0..37f3c339f8 100644 --- a/data/transactions/msgp_gen_test.go +++ b/data/transactions/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalApplicationCallTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := ApplicationCallTxnFields{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalApplicationCallTxnFields(t *testing.T) { } func TestRandomizedEncodingApplicationCallTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &ApplicationCallTxnFields{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalApplicationCallTxnFields(b *testing.B) { } func TestMarshalUnmarshalApplyData(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := ApplyData{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalApplyData(t *testing.T) { } func TestRandomizedEncodingApplyData(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &ApplyData{}) } @@ -139,7 +139,7 @@ func BenchmarkUnmarshalApplyData(b *testing.B) { } func TestMarshalUnmarshalAssetConfigTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AssetConfigTxnFields{} bts := v.MarshalMsg(nil) @@ -161,7 +161,7 @@ func TestMarshalUnmarshalAssetConfigTxnFields(t *testing.T) { } func TestRandomizedEncodingAssetConfigTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AssetConfigTxnFields{}) } @@ -202,7 +202,7 @@ func BenchmarkUnmarshalAssetConfigTxnFields(b *testing.B) { } func TestMarshalUnmarshalAssetFreezeTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AssetFreezeTxnFields{} bts := v.MarshalMsg(nil) @@ -224,7 +224,7 @@ func TestMarshalUnmarshalAssetFreezeTxnFields(t *testing.T) { } func TestRandomizedEncodingAssetFreezeTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AssetFreezeTxnFields{}) } @@ -265,7 +265,7 @@ func BenchmarkUnmarshalAssetFreezeTxnFields(b *testing.B) { } func TestMarshalUnmarshalAssetTransferTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AssetTransferTxnFields{} bts := v.MarshalMsg(nil) @@ -287,7 +287,7 @@ func TestMarshalUnmarshalAssetTransferTxnFields(t *testing.T) { } func TestRandomizedEncodingAssetTransferTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AssetTransferTxnFields{}) } @@ -328,7 +328,7 @@ func BenchmarkUnmarshalAssetTransferTxnFields(b *testing.B) { } func TestMarshalUnmarshalCompactCertTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := CompactCertTxnFields{} bts := v.MarshalMsg(nil) @@ -350,7 +350,7 @@ func TestMarshalUnmarshalCompactCertTxnFields(t *testing.T) { } func TestRandomizedEncodingCompactCertTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &CompactCertTxnFields{}) } @@ -391,7 +391,7 @@ func BenchmarkUnmarshalCompactCertTxnFields(b *testing.B) { } func TestMarshalUnmarshalHeader(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Header{} bts := v.MarshalMsg(nil) @@ -413,7 +413,7 @@ func TestMarshalUnmarshalHeader(t *testing.T) { } func TestRandomizedEncodingHeader(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Header{}) } @@ -454,7 +454,7 @@ func BenchmarkUnmarshalHeader(b *testing.B) { } func TestMarshalUnmarshalKeyregTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := KeyregTxnFields{} bts := v.MarshalMsg(nil) @@ -476,7 +476,7 @@ func TestMarshalUnmarshalKeyregTxnFields(t *testing.T) { } func TestRandomizedEncodingKeyregTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &KeyregTxnFields{}) } @@ -517,7 +517,7 @@ func BenchmarkUnmarshalKeyregTxnFields(b *testing.B) { } func TestMarshalUnmarshalLogicSig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := LogicSig{} bts := v.MarshalMsg(nil) @@ -539,7 +539,7 @@ func TestMarshalUnmarshalLogicSig(t *testing.T) { } func TestRandomizedEncodingLogicSig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &LogicSig{}) } @@ -580,7 +580,7 @@ func BenchmarkUnmarshalLogicSig(b *testing.B) { } func TestMarshalUnmarshalPaymentTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := PaymentTxnFields{} bts := v.MarshalMsg(nil) @@ -602,7 +602,7 @@ func TestMarshalUnmarshalPaymentTxnFields(t *testing.T) { } func TestRandomizedEncodingPaymentTxnFields(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &PaymentTxnFields{}) } @@ -643,7 +643,7 @@ func BenchmarkUnmarshalPaymentTxnFields(b *testing.B) { } func TestMarshalUnmarshalPayset(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Payset{} bts := v.MarshalMsg(nil) @@ -665,7 +665,7 @@ func TestMarshalUnmarshalPayset(t *testing.T) { } func TestRandomizedEncodingPayset(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Payset{}) } @@ -706,7 +706,7 @@ func BenchmarkUnmarshalPayset(b *testing.B) { } func TestMarshalUnmarshalSignedTxn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := SignedTxn{} bts := v.MarshalMsg(nil) @@ -728,7 +728,7 @@ func TestMarshalUnmarshalSignedTxn(t *testing.T) { } func TestRandomizedEncodingSignedTxn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &SignedTxn{}) } @@ -769,7 +769,7 @@ func BenchmarkUnmarshalSignedTxn(b *testing.B) { } func TestMarshalUnmarshalSignedTxnInBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := SignedTxnInBlock{} bts := v.MarshalMsg(nil) @@ -791,7 +791,7 @@ func TestMarshalUnmarshalSignedTxnInBlock(t *testing.T) { } func TestRandomizedEncodingSignedTxnInBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &SignedTxnInBlock{}) } @@ -832,7 +832,7 @@ func BenchmarkUnmarshalSignedTxnInBlock(b *testing.B) { } func TestMarshalUnmarshalSignedTxnWithAD(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := SignedTxnWithAD{} bts := v.MarshalMsg(nil) @@ -854,7 +854,7 @@ func TestMarshalUnmarshalSignedTxnWithAD(t *testing.T) { } func TestRandomizedEncodingSignedTxnWithAD(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &SignedTxnWithAD{}) } @@ -895,7 +895,7 @@ func BenchmarkUnmarshalSignedTxnWithAD(b *testing.B) { } func TestMarshalUnmarshalTransaction(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := Transaction{} bts := v.MarshalMsg(nil) @@ -917,7 +917,7 @@ func TestMarshalUnmarshalTransaction(t *testing.T) { } func TestRandomizedEncodingTransaction(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &Transaction{}) } @@ -958,7 +958,7 @@ func BenchmarkUnmarshalTransaction(b *testing.B) { } func TestMarshalUnmarshalTxGroup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := TxGroup{} bts := v.MarshalMsg(nil) @@ -980,7 +980,7 @@ func TestMarshalUnmarshalTxGroup(t *testing.T) { } func TestRandomizedEncodingTxGroup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &TxGroup{}) } diff --git a/data/transactions/payment_test.go b/data/transactions/payment_test.go index 59b383a041..7bdddd9920 100644 --- a/data/transactions/payment_test.go +++ b/data/transactions/payment_test.go @@ -24,7 +24,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func keypair() *crypto.SignatureSecrets { @@ -35,7 +35,7 @@ func keypair() *crypto.SignatureSecrets { } func TestAlgosEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var a basics.MicroAlgos var b basics.MicroAlgos diff --git a/data/transactions/payset_test.go b/data/transactions/payset_test.go index 23b3449db7..9b8633b624 100644 --- a/data/transactions/payset_test.go +++ b/data/transactions/payset_test.go @@ -19,7 +19,7 @@ package transactions import ( "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -36,7 +36,7 @@ func preparePayset(txnCount, acctCount int) Payset { return Payset(stxnb) } func TestPaysetCommitsToTxnOrder(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) payset := preparePayset(50, 50) commit1 := payset.CommitFlat() @@ -46,7 +46,7 @@ func TestPaysetCommitsToTxnOrder(t *testing.T) { } func TestEmptyPaysetCommitment(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const nilFlatPaysetHash = "WRS2VL2OQ5LPWBYLNBCZV3MEQ4DACSRDES6IUKHGOWYQERJRWC5A" const emptyFlatPaysetHash = "E54GFMNS2LISPG5VUGOQ3B2RR7TRKAHRE24LUM3HOW6TJGQ6PNZQ" diff --git a/data/transactions/signedtxn_test.go b/data/transactions/signedtxn_test.go index efe713d3d3..9826c8f487 100644 --- a/data/transactions/signedtxn_test.go +++ b/data/transactions/signedtxn_test.go @@ -23,11 +23,11 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) secrets := keypair() zeroPayment := Transaction{Type: protocol.PaymentTx} @@ -63,7 +63,7 @@ func TestEncoding(t *testing.T) { } func TestDecodeNil(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // This is a regression test for improper decoding of a nil SignedTxn. // This is a subtle case because decoding a msgpack nil does not run @@ -79,7 +79,7 @@ func TestDecodeNil(t *testing.T) { } func TestSignedTxnInBlockHash(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var stib SignedTxnInBlock crypto.RandBytes(stib.Txn.Sender[:]) diff --git a/data/transactions/transaction_test.go b/data/transactions/transaction_test.go index dcce788f18..d45d373f4d 100644 --- a/data/transactions/transaction_test.go +++ b/data/transactions/transaction_test.go @@ -26,12 +26,12 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestTransaction_EstimateEncodedSize(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) addr, err := basics.UnmarshalChecksumAddress("NDQCJNNY5WWWFLP4GFZ7MEF2QJSMZYK6OWIV2AQ7OMAVLEFCGGRHFPKJJA") require.NoError(t, err) @@ -83,7 +83,7 @@ func generateDummyGoNonparticpatingTransaction(addr basics.Address) (tx Transact } func TestGoOnlineGoNonparticipatingContradiction(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // addr has no significance here other than being a normal valid address addr, err := basics.UnmarshalChecksumAddress("NDQCJNNY5WWWFLP4GFZ7MEF2QJSMZYK6OWIV2AQ7OMAVLEFCGGRHFPKJJA") @@ -107,7 +107,7 @@ func TestGoOnlineGoNonparticipatingContradiction(t *testing.T) { } func TestGoNonparticipatingWellFormed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // addr has no significance here other than being a normal valid address addr, err := basics.UnmarshalChecksumAddress("NDQCJNNY5WWWFLP4GFZ7MEF2QJSMZYK6OWIV2AQ7OMAVLEFCGGRHFPKJJA") @@ -131,7 +131,7 @@ func TestGoNonparticipatingWellFormed(t *testing.T) { } func TestAppCallCreateWellFormed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) feeSink := basics.Address{0x7, 0xda, 0xcb, 0x4b, 0x6d, 0x9e, 0xd1, 0x41, 0xb1, 0x75, 0x76, 0xbd, 0x45, 0x9a, 0xe6, 0x42, 0x1d, 0x48, 0x6d, 0xa3, 0xd4, 0xef, 0x22, 0x47, 0xc4, 0x9, 0xa3, 0x96, 0xb8, 0x2e, 0xa2, 0x21} specialAddr := SpecialAddresses{FeeSink: feeSink} @@ -232,7 +232,7 @@ func TestAppCallCreateWellFormed(t *testing.T) { } func TestWellFormedErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) feeSink := basics.Address{0x7, 0xda, 0xcb, 0x4b, 0x6d, 0x9e, 0xd1, 0x41, 0xb1, 0x75, 0x76, 0xbd, 0x45, 0x9a, 0xe6, 0x42, 0x1d, 0x48, 0x6d, 0xa3, 0xd4, 0xef, 0x22, 0x47, 0xc4, 0x9, 0xa3, 0x96, 0xb8, 0x2e, 0xa2, 0x21} specialAddr := SpecialAddresses{FeeSink: feeSink} @@ -469,7 +469,7 @@ var generateFlag = flag.Bool("generate", false, "") // running test with -generate would generate the matrix used in the test ( without the "correct" errors ) func TestWellFormedKeyRegistrationTx(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) flag.Parse() diff --git a/data/transactions/verify/txn_test.go b/data/transactions/verify/txn_test.go index 063898a883..36ac93637b 100644 --- a/data/transactions/verify/txn_test.go +++ b/data/transactions/verify/txn_test.go @@ -30,7 +30,7 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/execpool" ) @@ -107,7 +107,7 @@ func generateTestObjects(numTxs, numAccs int, blockRound basics.Round) ([]transa } func TestSignedPayment(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] @@ -130,7 +130,7 @@ func TestSignedPayment(t *testing.T) { } func TestTxnValidationEncodeDecode(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) _, signed, _, _ := generateTestObjects(100, 50, 0) @@ -152,7 +152,7 @@ func TestTxnValidationEncodeDecode(t *testing.T) { } func TestTxnValidationEmptySig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) _, signed, _, _ := generateTestObjects(100, 50, 0) @@ -175,7 +175,7 @@ func TestTxnValidationEmptySig(t *testing.T) { const ccProto = protocol.ConsensusVersion("test-compact-cert-enabled") func TestTxnValidationCompactCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] proto.CompactCertRounds = 128 @@ -245,7 +245,7 @@ func TestTxnValidationCompactCert(t *testing.T) { } func TestDecodeNil(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // This is a regression test for improper decoding of a nil SignedTxn. // This is a subtle case because decoding a msgpack nil does not run @@ -263,7 +263,7 @@ func TestDecodeNil(t *testing.T) { } func TestPaysetGroups(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) _, signedTxn, secrets, addrs := generateTestObjects(10000, 20, 50) blkHdr := bookkeeping.BlockHeader{ diff --git a/data/transactions/verify/verifiedTxnCache_test.go b/data/transactions/verify/verifiedTxnCache_test.go index 9378a6e567..db1cddec71 100644 --- a/data/transactions/verify/verifiedTxnCache_test.go +++ b/data/transactions/verify/verifiedTxnCache_test.go @@ -24,11 +24,11 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestAddingToCache(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) icache := MakeVerifiedTransactionCache(500) impl := icache.(*verifiedTransactionCache) @@ -46,7 +46,7 @@ func TestAddingToCache(t *testing.T) { } func TestBucketCycling(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) bucketCount := 3 icache := MakeVerifiedTransactionCache(entriesPerBucket * bucketCount) @@ -76,7 +76,7 @@ func TestBucketCycling(t *testing.T) { } func TestGetUnverifiedTranscationGroups50(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) size := 300 icache := MakeVerifiedTransactionCache(size * 2) @@ -134,7 +134,7 @@ func BenchmarkGetUnverifiedTranscationGroups50(b *testing.B) { } func TestUpdatePinned(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) size := entriesPerBucket icache := MakeVerifiedTransactionCache(size * 10) @@ -163,7 +163,7 @@ func TestUpdatePinned(t *testing.T) { } func TestPinningTransactions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) size := entriesPerBucket icache := MakeVerifiedTransactionCache(size) diff --git a/ledger/accountdb_test.go b/ledger/accountdb_test.go index ec320a08c5..30fad6f926 100644 --- a/ledger/accountdb_test.go +++ b/ledger/accountdb_test.go @@ -37,7 +37,7 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" ) @@ -429,7 +429,7 @@ func checkAccounts(t *testing.T, tx *sql.Tx, rnd basics.Round, accts map[basics. } func TestAccountDBInit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] @@ -522,7 +522,7 @@ func creatablesFromUpdates(base map[basics.Address]basics.AccountData, updates l } func TestAccountDBRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] @@ -949,7 +949,7 @@ func BenchmarkWritingRandomBalancesDisk(b *testing.B) { require.NoError(b, err) } func TestAccountsReencoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) oldEncodedAccountsData := [][]byte{ {132, 164, 97, 108, 103, 111, 206, 5, 234, 236, 80, 164, 97, 112, 97, 114, 129, 206, 0, 3, 60, 164, 137, 162, 97, 109, 196, 32, 49, 54, 101, 102, 97, 97, 51, 57, 50, 52, 97, 54, 102, 100, 57, 100, 51, 97, 52, 56, 50, 52, 55, 57, 57, 97, 52, 97, 99, 54, 53, 100, 162, 97, 110, 167, 65, 80, 84, 75, 73, 78, 71, 162, 97, 117, 174, 104, 116, 116, 112, 58, 47, 47, 115, 111, 109, 101, 117, 114, 108, 161, 99, 196, 32, 183, 97, 139, 76, 1, 45, 180, 52, 183, 186, 220, 252, 85, 135, 185, 87, 156, 87, 158, 83, 49, 200, 133, 169, 43, 205, 26, 148, 50, 121, 28, 105, 161, 102, 196, 32, 183, 97, 139, 76, 1, 45, 180, 52, 183, 186, 220, 252, 85, 135, 185, 87, 156, 87, 158, 83, 49, 200, 133, 169, 43, 205, 26, 148, 50, 121, 28, 105, 161, 109, 196, 32, 60, 69, 244, 159, 234, 26, 168, 145, 153, 184, 85, 182, 46, 124, 227, 144, 84, 113, 176, 206, 109, 204, 245, 165, 100, 23, 71, 49, 32, 242, 146, 68, 161, 114, 196, 32, 183, 97, 139, 76, 1, 45, 180, 52, 183, 186, 220, 252, 85, 135, 185, 87, 156, 87, 158, 83, 49, 200, 133, 169, 43, 205, 26, 148, 50, 121, 28, 105, 161, 116, 205, 3, 32, 162, 117, 110, 163, 65, 80, 75, 165, 97, 115, 115, 101, 116, 129, 206, 0, 3, 60, 164, 130, 161, 97, 0, 161, 102, 194, 165, 101, 98, 97, 115, 101, 205, 98, 54}, @@ -1038,7 +1038,7 @@ func TestAccountsReencoding(t *testing.T) { // TestAccountsDbQueriesCreateClose tests to see that we can create the accountsDbQueries and close it. // it also verify that double-closing it doesn't create an issue. func TestAccountsDbQueriesCreateClose(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dbs, _ := dbOpenTest(t, true) setDbLogging(t, dbs) @@ -1155,7 +1155,7 @@ func BenchmarkWriteCatchpointStagingBalances(b *testing.B) { } func TestCompactAccountDeltas(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/ledger/acctupdates_test.go b/ledger/acctupdates_test.go index 9879874463..54fd6d4f0e 100644 --- a/ledger/acctupdates_test.go +++ b/ledger/acctupdates_test.go @@ -40,7 +40,7 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" ) @@ -310,7 +310,7 @@ func checkAcctUpdatesConsistency(t *testing.T, au *accountUpdates) { } func TestAcctUpdates(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { t.Skip("This test is too slow on ARM and causes travis builds to time out") @@ -396,7 +396,7 @@ func TestAcctUpdates(t *testing.T) { } func TestAcctUpdatesFastUpdates(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { t.Skip("This test is too slow on ARM and causes travis builds to time out") @@ -609,7 +609,7 @@ func BenchmarkCalibrateCacheNodeSize(b *testing.B) { // and attempts to have the accountUpdates create the associated catchpoint. It's designed precisely around setting an // environment which would quickly ( i.e. after 32 rounds ) would start producing catchpoints. func TestLargeAccountCountCatchpointGeneration(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { t.Skip("This test is too slow on ARM and causes travis builds to time out") @@ -699,7 +699,7 @@ func TestLargeAccountCountCatchpointGeneration(t *testing.T) { // In addition, throughout the test, we check ( using lookup ) that the historical balances, *beyond* the // lookback are generating either an error, or returning the correct amount. func TestAcctUpdatesUpdatesCorrectness(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { t.Skip("This test is too slow on ARM and causes travis builds to time out") @@ -875,7 +875,7 @@ func TestAcctUpdatesUpdatesCorrectness(t *testing.T) { // and ensures that it did not errored, the catchpoint files were correctly deleted, and that deleteStoredCatchpoints contains no more // entries. func TestAcctUpdatesDeleteStoredCatchpoints(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] @@ -1031,7 +1031,7 @@ func listAndCompare(t *testing.T, // It tests with all elements in cache, all synced to database, and combination of both // It also tests the max results, max app index and max asset index func TestListCreatables(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // test configuration parameters numElementsPerSegement := 25 @@ -1098,7 +1098,7 @@ func TestListCreatables(t *testing.T) { } func TestIsWritingCatchpointFile(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) au := &accountUpdates{} @@ -1112,7 +1112,7 @@ func TestIsWritingCatchpointFile(t *testing.T) { } func TestGetCatchpointStream(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusCurrentVersion] @@ -1381,7 +1381,7 @@ func BenchmarkCompactDeltas(b *testing.B) { }) } func TestCompactDeltas(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) addrs := make([]basics.Address, 10) for i := 0; i < len(addrs); i++ { @@ -1442,7 +1442,7 @@ func TestCompactDeltas(t *testing.T) { } func TestReproducibleCatchpointLabels(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { t.Skip("This test is too slow on ARM and causes travis builds to time out") @@ -1566,7 +1566,7 @@ func TestReproducibleCatchpointLabels(t *testing.T) { // TestCachesInitialization test the functionality of the initializeCaches cache. func TestCachesInitialization(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocolVersion := protocol.ConsensusCurrentVersion proto := config.Consensus[protocolVersion] @@ -1660,7 +1660,7 @@ func TestCachesInitialization(t *testing.T) { // TestSplittingConsensusVersionCommits tests the a sequence of commits that spans over multiple consensus versions works correctly. func TestSplittingConsensusVersionCommits(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) initProtocolVersion := protocol.ConsensusV20 initialProtoParams := config.Consensus[initProtocolVersion] @@ -1774,7 +1774,7 @@ func TestSplittingConsensusVersionCommits(t *testing.T) { // TestSplittingConsensusVersionCommitsBoundry tests the a sequence of commits that spans over multiple consensus versions works correctly, and // in particular, complements TestSplittingConsensusVersionCommits by testing the commit boundary. func TestSplittingConsensusVersionCommitsBoundry(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) initProtocolVersion := protocol.ConsensusV20 initialProtoParams := config.Consensus[initProtocolVersion] @@ -1919,7 +1919,7 @@ func TestSplittingConsensusVersionCommitsBoundry(t *testing.T) { // TestConsecutiveVersion tests the consecutiveVersion method correctness. func TestConsecutiveVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var au accountUpdates au.versions = []protocol.ConsensusVersion{ diff --git a/ledger/appcow_test.go b/ledger/appcow_test.go index 474e3c2877..d4c33f8835 100644 --- a/ledger/appcow_test.go +++ b/ledger/appcow_test.go @@ -30,7 +30,7 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type addrApp struct { @@ -190,7 +190,7 @@ func randomAddrApps(n int) ([]storagePtr, []basics.Address) { } func TestCowStorage(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ml := emptyLedger{} var bh bookkeeping.BlockHeader @@ -357,7 +357,7 @@ func TestCowStorage(t *testing.T) { } func TestCowBuildDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -602,7 +602,7 @@ func TestCowBuildDelta(t *testing.T) { } func TestCowDeltaSerialize(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -670,7 +670,7 @@ func TestCowDeltaSerialize(t *testing.T) { } func TestApplyChild(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -802,7 +802,7 @@ func TestApplyChild(t *testing.T) { } func TestApplyStorageDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -932,7 +932,7 @@ func TestApplyStorageDelta(t *testing.T) { } func TestCowAllocated(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -961,7 +961,7 @@ func TestCowAllocated(t *testing.T) { } func TestCowGetCreator(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -984,7 +984,7 @@ func TestCowGetCreator(t *testing.T) { } func TestCowGetters(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1002,7 +1002,7 @@ func TestCowGetters(t *testing.T) { } func TestCowGet(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1027,7 +1027,7 @@ func TestCowGet(t *testing.T) { } func TestCowGetKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1100,7 +1100,7 @@ func TestCowGetKey(t *testing.T) { } func TestCowSetKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1195,7 +1195,7 @@ func TestCowSetKey(t *testing.T) { } func TestCowSetKeyVFuture(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1230,7 +1230,7 @@ func TestCowSetKeyVFuture(t *testing.T) { } func TestCowAccountIdx(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1278,7 +1278,7 @@ func TestCowAccountIdx(t *testing.T) { } func TestCowDelKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/ledger/applications_test.go b/ledger/applications_test.go index 5f7c0878d2..14bdec0c7f 100644 --- a/ledger/applications_test.go +++ b/ledger/applications_test.go @@ -31,7 +31,7 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func getRandomAddress(a *require.Assertions) basics.Address { @@ -136,7 +136,7 @@ func newCowMock(creatables []modsData) *mockCowForLogicLedger { } func TestLogicLedgerMake(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -165,7 +165,7 @@ func TestLogicLedgerMake(t *testing.T) { } func TestLogicLedgerBalances(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -185,7 +185,7 @@ func TestLogicLedgerBalances(t *testing.T) { } func TestLogicLedgerGetters(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -213,7 +213,7 @@ func TestLogicLedgerGetters(t *testing.T) { } func TestLogicLedgerAsset(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -258,7 +258,7 @@ func TestLogicLedgerAsset(t *testing.T) { } func TestLogicLedgerGetKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -301,7 +301,7 @@ func TestLogicLedgerGetKey(t *testing.T) { } func TestLogicLedgerSetKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -331,7 +331,7 @@ func TestLogicLedgerSetKey(t *testing.T) { } func TestLogicLedgerDelKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -365,7 +365,7 @@ func TestLogicLedgerDelKey(t *testing.T) { // 2) writing into empty (opted-in) local state's KeyValue works after reloading // Hardcoded values are from commit 9a0b439 (pre app refactor commit) func TestAppAccountDataStorage(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) source := `#pragma version 2 @@ -592,7 +592,7 @@ return` } func TestAppAccountDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) source := `#pragma version 2 @@ -871,7 +871,7 @@ return` } func TestAppEmptyAccountsLocal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) source := `#pragma version 2 @@ -1023,7 +1023,7 @@ return` } func TestAppEmptyAccountsGlobal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) source := `#pragma version 2 @@ -1156,7 +1156,7 @@ return` } func TestAppAccountDeltaIndicesCompatibility1(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) source := `#pragma version 2 txn ApplicationID @@ -1179,7 +1179,7 @@ int 1 } func TestAppAccountDeltaIndicesCompatibility2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) source := `#pragma version 2 txn ApplicationID @@ -1202,7 +1202,7 @@ int 1 } func TestAppAccountDeltaIndicesCompatibility3(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) source := `#pragma version 2 txn ApplicationID diff --git a/ledger/apply/application_test.go b/ledger/apply/application_test.go index 814573db79..6401ac545b 100644 --- a/ledger/apply/application_test.go +++ b/ledger/apply/application_test.go @@ -30,11 +30,11 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestApplicationCallFieldsEmpty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -276,7 +276,7 @@ func (e *testEvaluator) InitLedger(balances Balances, appIdx basics.AppIndex, sc } func TestAppCallCloneEmpty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -290,7 +290,7 @@ func TestAppCallCloneEmpty(t *testing.T) { } func TestAppCallGetParam(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -330,7 +330,7 @@ func TestAppCallGetParam(t *testing.T) { } func TestAppCallAddressByIndex(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -357,7 +357,7 @@ func TestAppCallAddressByIndex(t *testing.T) { } func TestAppCallCheckPrograms(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -397,7 +397,7 @@ func TestAppCallCheckPrograms(t *testing.T) { } func TestAppCallCreate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -441,7 +441,7 @@ func TestAppCallCreate(t *testing.T) { // TestAppCallApplyCreate carefully tracks and validates balance record updates func TestAppCallApplyCreate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -560,7 +560,7 @@ func TestAppCallApplyCreate(t *testing.T) { // TestAppCallApplyCreateOptIn checks balance record fields without tracking substages func TestAppCallApplyCreateOptIn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -607,7 +607,7 @@ func TestAppCallApplyCreateOptIn(t *testing.T) { } func TestAppCallOptIn(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -682,7 +682,7 @@ func TestAppCallOptIn(t *testing.T) { } func TestAppCallClearState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -838,7 +838,7 @@ func TestAppCallClearState(t *testing.T) { } func TestAppCallApplyCloseOut(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -922,7 +922,7 @@ func TestAppCallApplyCloseOut(t *testing.T) { } func TestAppCallApplyUpdate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -990,7 +990,7 @@ func TestAppCallApplyUpdate(t *testing.T) { } func TestAppCallApplyDelete(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1058,7 +1058,7 @@ func TestAppCallApplyDelete(t *testing.T) { } func TestAppCallApplyCreateClearState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1108,7 +1108,7 @@ func TestAppCallApplyCreateClearState(t *testing.T) { } func TestAppCallApplyCreateDelete(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/ledger/apply/asset_test.go b/ledger/apply/asset_test.go index 6cff57ab65..3fbad27c70 100644 --- a/ledger/apply/asset_test.go +++ b/ledger/apply/asset_test.go @@ -26,11 +26,11 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestAssetTransfer(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Creator secretSrc := keypair() diff --git a/ledger/apply/keyreg_test.go b/ledger/apply/keyreg_test.go index 515139e0ae..10c449102b 100644 --- a/ledger/apply/keyreg_test.go +++ b/ledger/apply/keyreg_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -79,7 +79,7 @@ func (balances keyregTestBalances) StatefulEval(logic.EvalParams, basics.AppInde } func TestKeyregApply(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) secretSrc := keypair() src := basics.Address(secretSrc.SignatureVerifier) diff --git a/ledger/apply/payment_test.go b/ledger/apply/payment_test.go index 8cc3c855ae..09b55306da 100644 --- a/ledger/apply/payment_test.go +++ b/ledger/apply/payment_test.go @@ -27,7 +27,7 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var poolAddr = basics.Address{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} @@ -45,7 +45,7 @@ func keypair() *crypto.SignatureSecrets { } func TestAlgosEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var a basics.MicroAlgos var b basics.MicroAlgos @@ -80,7 +80,7 @@ func TestAlgosEncoding(t *testing.T) { } func TestPaymentApply(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) mockBalV0 := makeMockBalances(protocol.ConsensusCurrentVersion) @@ -109,7 +109,7 @@ func TestPaymentApply(t *testing.T) { } func TestCheckSpender(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) mockBalV0 := makeMockBalances(protocol.ConsensusCurrentVersion) mockBalV7 := makeMockBalances(protocol.ConsensusV7) @@ -150,7 +150,7 @@ func TestCheckSpender(t *testing.T) { } func TestPaymentValidation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) payments, _, _, _ := generateTestObjects(100, 50) genHash := crypto.Digest{0x42} @@ -245,7 +245,7 @@ func TestPaymentValidation(t *testing.T) { } func TestPaymentSelfClose(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) secretSrc := keypair() src := basics.Address(secretSrc.SignatureVerifier) diff --git a/ledger/archival_test.go b/ledger/archival_test.go index 9af7b339ef..8ec3c61274 100644 --- a/ledger/archival_test.go +++ b/ledger/archival_test.go @@ -43,7 +43,7 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" ) @@ -113,7 +113,7 @@ func getInitState() (genesisInitState InitState) { } func TestArchival(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // This test ensures that trackers return the correct value from // committedUpTo() -- that is, if they return round rnd, then they @@ -178,7 +178,7 @@ func TestArchival(t *testing.T) { } func TestArchivalRestart(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Start in archival mode, add 2K blocks, restart, ensure all blocks are there @@ -326,7 +326,7 @@ func makeUnsignedApplicationCallTx(appIdx uint64, onCompletion transactions.OnCo } func TestArchivalCreatables(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Start in archival mode, add 2K blocks with asset + app txns // restart, ensure all assets are there in index unless they were @@ -684,7 +684,7 @@ func makeSignedTxnInBlock(tx transactions.Transaction) transactions.SignedTxnInB } func TestArchivalFromNonArchival(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Start in non-archival mode, add 2K blocks, restart in archival mode ensure only genesis block is there deadlockDisable := deadlock.Opts.Disable diff --git a/ledger/blockdb_test.go b/ledger/blockdb_test.go index ae6066877c..0c2fa8ecd5 100644 --- a/ledger/blockdb_test.go +++ b/ledger/blockdb_test.go @@ -30,7 +30,7 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" ) @@ -119,7 +119,7 @@ func setDbLogging(t testing.TB, dbs db.Pair) { } func TestBlockDBEmpty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dbs, _ := dbOpenTest(t, true) setDbLogging(t, dbs) @@ -135,7 +135,7 @@ func TestBlockDBEmpty(t *testing.T) { } func TestBlockDBInit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dbs, _ := dbOpenTest(t, true) setDbLogging(t, dbs) @@ -157,7 +157,7 @@ func TestBlockDBInit(t *testing.T) { } func TestBlockDBAppend(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dbs, _ := dbOpenTest(t, true) setDbLogging(t, dbs) diff --git a/ledger/blockqueue_test.go b/ledger/blockqueue_test.go index 3d3cdd7777..9b69d277de 100644 --- a/ledger/blockqueue_test.go +++ b/ledger/blockqueue_test.go @@ -30,11 +30,11 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestPutBlockTooOld(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) genesisInitState, _, _ := genesis(10) @@ -65,7 +65,7 @@ func TestPutBlockTooOld(t *testing.T) { // TestGetEncodedBlockCert tests getEncodedBlockCert with valid and invalid round numbers. func TestGetEncodedBlockCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) genesisInitState, _, _ := genesis(10) diff --git a/ledger/bulletin_test.go b/ledger/bulletin_test.go index 88569c54d3..cf8d160434 100644 --- a/ledger/bulletin_test.go +++ b/ledger/bulletin_test.go @@ -17,7 +17,7 @@ package ledger import ( - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "testing" "time" ) @@ -25,7 +25,7 @@ import ( const epsilon = 5 * time.Millisecond func TestBulletin(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) bul := makeBulletin() diff --git a/ledger/catchpointwriter_test.go b/ledger/catchpointwriter_test.go index aa931aef8c..932ab37ad6 100644 --- a/ledger/catchpointwriter_test.go +++ b/ledger/catchpointwriter_test.go @@ -35,7 +35,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func makeString(len int) string { @@ -139,7 +139,7 @@ func makeTestEncodedBalanceRecord(t *testing.T) encodedBalanceRecord { } func TestEncodedBalanceRecordEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) er := makeTestEncodedBalanceRecord(t) encodedBr := er.MarshalMsg(nil) @@ -152,7 +152,7 @@ func TestEncodedBalanceRecordEncoding(t *testing.T) { } func TestCatchpointFileBalancesChunkEncoding(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) fbc := catchpointFileBalancesChunk{} for i := 0; i < 512; i++ { @@ -168,7 +168,7 @@ func TestCatchpointFileBalancesChunkEncoding(t *testing.T) { } func TestBasicCatchpointWriter(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // create new protocol version, which has lower lookback testProtocolVersion := protocol.ConsensusVersion("test-protocol-TestBasicCatchpointWriter") @@ -268,7 +268,7 @@ func TestBasicCatchpointWriter(t *testing.T) { } func TestFullCatchpointWriter(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // create new protocol version, which has lower lookback testProtocolVersion := protocol.ConsensusVersion("test-protocol-TestFullCatchpointWriter") diff --git a/ledger/catchupaccessor_test.go b/ledger/catchupaccessor_test.go index 9643f9392d..576280d8e4 100644 --- a/ledger/catchupaccessor_test.go +++ b/ledger/catchupaccessor_test.go @@ -34,7 +34,7 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func createTestingEncodedChunks(accountsCount uint64) (encodedAccountChunks [][]byte, last64KIndex int) { @@ -140,7 +140,7 @@ func BenchmarkRestoringFromCatchpointFile(b *testing.B) { } func TestCatchupAcessorFoo(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) log := logging.TestingLog(t) dbBaseFileName := t.Name() @@ -195,7 +195,7 @@ func TestCatchupAcessorFoo(t *testing.T) { } func TestBuildMerkleTrie(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // setup boilerplate log := logging.TestingLog(t) @@ -294,7 +294,7 @@ func TestBuildMerkleTrie(t *testing.T) { // TODO: blockEnsureSingleBlock called from EnsureFirstBlock() func TestCatchupAccessorBlockdb(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // setup boilerplate log := logging.TestingLog(t) @@ -320,7 +320,7 @@ func TestCatchupAccessorBlockdb(t *testing.T) { } func TestVerifyCatchpoint(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // setup boilerplate log := logging.TestingLog(t) diff --git a/ledger/compactcert_test.go b/ledger/compactcert_test.go index 3241126e4a..27e4668113 100644 --- a/ledger/compactcert_test.go +++ b/ledger/compactcert_test.go @@ -27,11 +27,11 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestValidateCompactCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var certHdr bookkeeping.BlockHeader var cert compactcert.Cert @@ -100,7 +100,7 @@ func TestValidateCompactCert(t *testing.T) { } func TestAcceptableCompactCertWeight(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var votersHdr bookkeeping.BlockHeader var firstValid basics.Round @@ -146,7 +146,7 @@ func TestAcceptableCompactCertWeight(t *testing.T) { } func TestCompactCertParams(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var votersHdr bookkeeping.BlockHeader var hdr bookkeeping.BlockHeader diff --git a/ledger/cow_test.go b/ledger/cow_test.go index 9285f7ecc3..47bc3d7a77 100644 --- a/ledger/cow_test.go +++ b/ledger/cow_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/ledger/ledgercore" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type mockLedger struct { @@ -107,7 +107,7 @@ func applyUpdates(cow *roundCowState, updates ledgercore.AccountDeltas) { } func TestCowBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) accts0 := randomAccounts(20, true) ml := mockLedger{balanceMap: accts0} diff --git a/ledger/eval_test.go b/ledger/eval_test.go index 4b05d44cd9..9d3315a1b4 100644 --- a/ledger/eval_test.go +++ b/ledger/eval_test.go @@ -39,7 +39,7 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/execpool" ) @@ -53,7 +53,7 @@ func init() { } func TestBlockEvaluator(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) genesisInitState, addrs, keys := genesis(10) @@ -225,7 +225,7 @@ func TestBlockEvaluator(t *testing.T) { } func TestRekeying(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Pretend rekeying is supported actual := config.Consensus[protocol.ConsensusCurrentVersion] @@ -332,7 +332,7 @@ func TestRekeying(t *testing.T) { } func TestPrepareEvalParams(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) eval := BlockEvaluator{ prevHeader: bookkeeping.BlockHeader{ @@ -539,7 +539,7 @@ ok: // commitToParent -> applyChild copies child's cow state usage counts into parent // and the usage counts correctly propagated from parent cow to child cow and back func TestEvalAppStateCountsWithTxnGroup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) _, _, err := testEvalAppGroup(t, basics.StateSchema{NumByteSlice: 1}) require.Error(t, err) @@ -549,7 +549,7 @@ func TestEvalAppStateCountsWithTxnGroup(t *testing.T) { // TestEvalAppAllocStateWithTxnGroup ensures roundCowState.deltas and applyStorageDelta // produce correct results when a txn group has storage allocate and storage update actions func TestEvalAppAllocStateWithTxnGroup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) eval, addr, err := testEvalAppGroup(t, basics.StateSchema{NumByteSlice: 2}) require.NoError(t, err) @@ -688,7 +688,7 @@ func benchmarkBlockEvaluator(b *testing.B, inMem bool, withCrypto bool) { } func TestCowCompactCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var certRnd basics.Round var certType protocol.CompactCertType @@ -748,7 +748,7 @@ func TestCowCompactCert(t *testing.T) { // a couple trivial tests that don't need setup // see TestBlockEvaluator for more func TestTestTransactionGroup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var txgroup []transactions.SignedTxn eval := BlockEvaluator{} @@ -764,7 +764,7 @@ func TestTestTransactionGroup(t *testing.T) { // test BlockEvaluator.transactionGroup() // some trivial checks that require no setup func TestPrivateTransactionGroup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var txgroup []transactions.SignedTxnWithAD eval := BlockEvaluator{} @@ -780,7 +780,7 @@ func TestPrivateTransactionGroup(t *testing.T) { // BlockEvaluator.workaroundOverspentRewards() fixed a couple issues on testnet. // This is now part of history and has to be re-created when running catchup on testnet. So, test to ensure it keeps happenning. func TestTestnetFixup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) eval := &BlockEvaluator{} var rewardPoolBalance basics.AccountData diff --git a/ledger/ledger_test.go b/ledger/ledger_test.go index 954218979c..432e118486 100644 --- a/ledger/ledger_test.go +++ b/ledger/ledger_test.go @@ -38,7 +38,7 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/execpool" ) @@ -255,7 +255,7 @@ func (l *Ledger) addBlockTxns(t *testing.T, accounts map[basics.Address]basics.A } func TestLedgerBasic(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) genesisInitState, _ := testGenerateInitState(t, protocol.ConsensusCurrentVersion, 100) const inMem = true @@ -268,7 +268,7 @@ func TestLedgerBasic(t *testing.T) { } func TestLedgerBlockHeaders(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -411,7 +411,7 @@ func TestLedgerBlockHeaders(t *testing.T) { } func TestLedgerSingleTx(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -616,7 +616,7 @@ func TestLedgerSingleTx(t *testing.T) { } func TestLedgerSingleTxV24(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -787,7 +787,7 @@ func addEmptyValidatedBlock(t *testing.T, l *Ledger, initAccounts map[basics.Add // TestLedgerAppCrossRoundWrites ensures app state writes survive between rounds func TestLedgerAppCrossRoundWrites(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -925,7 +925,7 @@ int 1 // TestLedgerAppMultiTxnWrites ensures app state writes in multiple txn are applied func TestLedgerAppMultiTxnWrites(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -1322,44 +1322,44 @@ func testLedgerSingleTxApplyData(t *testing.T, version protocol.ConsensusVersion } func TestLedgerSingleTxApplyData(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLedgerSingleTxApplyData(t, protocol.ConsensusCurrentVersion) } // SupportTransactionLeases was introduced after v18. func TestLedgerSingleTxApplyDataV18(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLedgerSingleTxApplyData(t, protocol.ConsensusV18) } func TestLedgerSingleTxApplyDataFuture(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLedgerSingleTxApplyData(t, protocol.ConsensusFuture) } func TestLedgerRegressionFaultyLeaseFirstValidCheckOld(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLedgerRegressionFaultyLeaseFirstValidCheck2f3880f7(t, protocol.ConsensusV22) } func TestLedgerRegressionFaultyLeaseFirstValidCheckV23(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLedgerRegressionFaultyLeaseFirstValidCheck2f3880f7(t, protocol.ConsensusV23) } func TestLedgerRegressionFaultyLeaseFirstValidCheck(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLedgerRegressionFaultyLeaseFirstValidCheck2f3880f7(t, protocol.ConsensusCurrentVersion) } func TestLedgerRegressionFaultyLeaseFirstValidCheckFuture(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testLedgerRegressionFaultyLeaseFirstValidCheck2f3880f7(t, protocol.ConsensusFuture) } @@ -1427,7 +1427,7 @@ func testLedgerRegressionFaultyLeaseFirstValidCheck2f3880f7(t *testing.T, versio } func TestLedgerBlockHdrCaching(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dbName := fmt.Sprintf("%s.%d", t.Name(), crypto.RandUint64()) genesisInitState := getInitState() @@ -1454,7 +1454,7 @@ func TestLedgerBlockHdrCaching(t *testing.T) { } func TestLedgerReload(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dbName := fmt.Sprintf("%s.%d", t.Name(), crypto.RandUint64()) genesisInitState := getInitState() @@ -1490,7 +1490,7 @@ func TestLedgerReload(t *testing.T) { // TestGetLastCatchpointLabel tests ledger.GetLastCatchpointLabel is returning the correct value. func TestGetLastCatchpointLabel(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) //initLedger genesisInitState, _ := testGenerateInitState(t, protocol.ConsensusCurrentVersion, 100) @@ -1567,7 +1567,7 @@ func generateCreatables(numElementsPerSegement int) ( // interfaces. The detailed test on the correctness of these functions is given in: // TestListCreatables (acctupdates_test.go) func TestListAssetsAndApplications(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numElementsPerSegement := 10 // This is multiplied by 10. see randomCreatables @@ -1627,7 +1627,7 @@ func TestListAssetsAndApplications(t *testing.T) { } func TestLedgerMemoryLeak(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip() // for manual runs only dbName := fmt.Sprintf("%s.%d", t.Name(), crypto.RandUint64()) diff --git a/ledger/ledgercore/catchpointlabel_test.go b/ledger/ledgercore/catchpointlabel_test.go index f4ae5e7d1e..cfe744baa2 100644 --- a/ledger/ledgercore/catchpointlabel_test.go +++ b/ledger/ledgercore/catchpointlabel_test.go @@ -23,11 +23,11 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestUniqueCatchpointLabel(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) uniqueSet := make(map[string]bool) @@ -58,7 +58,7 @@ func TestUniqueCatchpointLabel(t *testing.T) { } func TestCatchpointLabelParsing(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledgerRoundBlockHashes := []crypto.Digest{} balancesMerkleRoots := []crypto.Digest{} @@ -88,7 +88,7 @@ func TestCatchpointLabelParsing(t *testing.T) { } } func TestCatchpointLabelParsing2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) _, _, err := ParseCatchpointLabel("5893060#KURJLS6EWBEVXTMLC7NP3NABTUMQP32QUJOBBW2TT23376L6RWJAB") require.Error(t, err) diff --git a/ledger/ledgercore/msgp_gen_test.go b/ledger/ledgercore/msgp_gen_test.go index 793a3d4a47..4e1343c794 100644 --- a/ledger/ledgercore/msgp_gen_test.go +++ b/ledger/ledgercore/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalAccountTotals(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AccountTotals{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalAccountTotals(t *testing.T) { } func TestRandomizedEncodingAccountTotals(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AccountTotals{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalAccountTotals(b *testing.B) { } func TestMarshalUnmarshalAlgoCount(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := AlgoCount{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalAlgoCount(t *testing.T) { } func TestRandomizedEncodingAlgoCount(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &AlgoCount{}) } diff --git a/ledger/ledgercore/statedelta_test.go b/ledger/ledgercore/statedelta_test.go index 744c2388af..f2f8bf7ad4 100644 --- a/ledger/ledgercore/statedelta_test.go +++ b/ledger/ledgercore/statedelta_test.go @@ -23,7 +23,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func randomAddress() basics.Address { @@ -33,7 +33,7 @@ func randomAddress() basics.Address { } func TestAccountDeltas(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/ledger/ledgercore/totals_test.go b/ledger/ledgercore/totals_test.go index 9df3623fa8..cabbd45e4e 100644 --- a/ledger/ledgercore/totals_test.go +++ b/ledger/ledgercore/totals_test.go @@ -23,11 +23,11 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestAccountTotalsCanMarshalMsg(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var at *AccountTotals require.True(t, at.CanMarshalMsg(interface{}(at))) @@ -36,7 +36,7 @@ func TestAccountTotalsCanMarshalMsg(t *testing.T) { require.False(t, at.CanUnmarshalMsg(interface{}(t))) } func TestAccountTotalsMarshalMsg(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) at := AccountTotals{ Online: AlgoCount{ @@ -64,7 +64,7 @@ func TestAccountTotalsMarshalMsg(t *testing.T) { } func TestAlgoCountMarshalMsg(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ac := AlgoCount{ Money: basics.MicroAlgos{Raw: 0x4321432143214321}, @@ -204,7 +204,7 @@ var uniqueAccountTotals = []AccountTotals{ } func TestAccountTotalsMarshalMsgUnique(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) uniqueAt := make(map[crypto.Digest]bool, 0) for _, at := range uniqueAccountTotals { @@ -217,7 +217,7 @@ func TestAccountTotalsMarshalMsgUnique(t *testing.T) { } func TestAccountTotalsMarshalUnMarshal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for _, at := range uniqueAccountTotals { inBuffer := make([]byte, 0, 128) diff --git a/ledger/lruaccts_test.go b/ledger/lruaccts_test.go index c6dcd214f3..4c4d12ca31 100644 --- a/ledger/lruaccts_test.go +++ b/ledger/lruaccts_test.go @@ -26,11 +26,11 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestBasicLRUAccounts(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var baseAcct lruAccounts baseAcct.init(logging.TestingLog(t), 10, 5) @@ -88,7 +88,7 @@ func TestBasicLRUAccounts(t *testing.T) { } func TestLRUAccountsPendingWrites(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var baseAcct lruAccounts accountsNum := 250 @@ -140,7 +140,7 @@ func (cl *lruAccountsTestLogger) Warnf(s string, args ...interface{}) { } func TestLRUAccountsPendingWritesWarning(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var baseAcct lruAccounts pendingWritesBuffer := 50 @@ -166,7 +166,7 @@ func TestLRUAccountsPendingWritesWarning(t *testing.T) { } func TestLRUAccountsOmittedPendingWrites(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var baseAcct lruAccounts pendingWritesBuffer := 50 diff --git a/ledger/msgp_gen_test.go b/ledger/msgp_gen_test.go index cef7c49204..1652ae794a 100644 --- a/ledger/msgp_gen_test.go +++ b/ledger/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalCatchpointFileHeader(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := CatchpointFileHeader{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalCatchpointFileHeader(t *testing.T) { } func TestRandomizedEncodingCatchpointFileHeader(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &CatchpointFileHeader{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalCatchpointFileHeader(b *testing.B) { } func TestMarshalUnmarshalcatchpointFileBalancesChunk(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := catchpointFileBalancesChunk{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalcatchpointFileBalancesChunk(t *testing.T) { } func TestRandomizedEncodingcatchpointFileBalancesChunk(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &catchpointFileBalancesChunk{}) } @@ -139,7 +139,7 @@ func BenchmarkUnmarshalcatchpointFileBalancesChunk(b *testing.B) { } func TestMarshalUnmarshalencodedBalanceRecord(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := encodedBalanceRecord{} bts := v.MarshalMsg(nil) @@ -161,7 +161,7 @@ func TestMarshalUnmarshalencodedBalanceRecord(t *testing.T) { } func TestRandomizedEncodingencodedBalanceRecord(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &encodedBalanceRecord{}) } diff --git a/ledger/onlineacct_test.go b/ledger/onlineacct_test.go index a0198c3034..c1d05fa153 100644 --- a/ledger/onlineacct_test.go +++ b/ledger/onlineacct_test.go @@ -23,11 +23,11 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestOnlineTopHeap_Less(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := onlineTopHeap{ accts: []*onlineAccount{ @@ -56,7 +56,7 @@ func TestOnlineTopHeap_Less(t *testing.T) { } func TestOnlineTopHeap_Swap(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := onlineTopHeap{ accts: []*onlineAccount{ @@ -85,7 +85,7 @@ func TestOnlineTopHeap_Swap(t *testing.T) { } func TestOnlineTopHeap_Push(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := onlineTopHeap{ accts: []*onlineAccount{ @@ -116,7 +116,7 @@ func TestOnlineTopHeap_Push(t *testing.T) { } func TestOnlineTopHeap_Pop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) h := onlineTopHeap{ accts: []*onlineAccount{ diff --git a/ledger/roundlru_test.go b/ledger/roundlru_test.go index 26669287d5..7837bd555f 100644 --- a/ledger/roundlru_test.go +++ b/ledger/roundlru_test.go @@ -22,7 +22,7 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func getEq(t *testing.T, cache *heapLRUCache, r basics.Round, expected string) { @@ -46,7 +46,7 @@ func getNone(t *testing.T, cache *heapLRUCache, r basics.Round) { } func TestRoundLRUBasic(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cache := heapLRUCache{maxEntries: 3} cache.Put(1, "one") @@ -66,7 +66,7 @@ func TestRoundLRUBasic(t *testing.T) { } func TestRoundLRUReIndex(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) cache := heapLRUCache{ entries: lruHeap{ diff --git a/ledger/txtail_test.go b/ledger/txtail_test.go index 5e3da7fd2d..97d5a5cbba 100644 --- a/ledger/txtail_test.go +++ b/ledger/txtail_test.go @@ -29,11 +29,11 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTxTailCheckdup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) ledger := makeMockLedgerForTracker(t, true, 1, protocol.ConsensusCurrentVersion) proto := config.Consensus[protocol.ConsensusCurrentVersion] diff --git a/netdeploy/networkTemplates_test.go b/netdeploy/networkTemplates_test.go index 66832b89fe..cc31f73aa0 100644 --- a/netdeploy/networkTemplates_test.go +++ b/netdeploy/networkTemplates_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/config" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLoadConfig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -42,7 +42,7 @@ func TestLoadConfig(t *testing.T) { } func TestLoadMissingConfig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -53,7 +53,7 @@ func TestLoadMissingConfig(t *testing.T) { } func TestGenerateGenesis(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -73,7 +73,7 @@ func TestGenerateGenesis(t *testing.T) { } func TestValidate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/netdeploy/network_test.go b/netdeploy/network_test.go index 30a59abed5..958930fac1 100644 --- a/netdeploy/network_test.go +++ b/netdeploy/network_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/config" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestSaveNetworkCfg(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -49,7 +49,7 @@ func TestSaveNetworkCfg(t *testing.T) { } func TestSaveConsensus(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/netdeploy/remote/bootstrappedNetwork_test.go b/netdeploy/remote/bootstrappedNetwork_test.go index ec42be6d7a..ba1722d94c 100644 --- a/netdeploy/remote/bootstrappedNetwork_test.go +++ b/netdeploy/remote/bootstrappedNetwork_test.go @@ -20,12 +20,12 @@ import ( "path/filepath" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestLoadBootstrappedData(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) badSpecPath := filepath.Join("./../../test", "testdata/deployednettemplates/networks/bootstrapped/badSpec.json") _, err := LoadBootstrappedData(badSpecPath) diff --git a/netdeploy/remote/deployedNetwork_test.go b/netdeploy/remote/deployedNetwork_test.go index 232f5aeffa..2994249430 100644 --- a/netdeploy/remote/deployedNetwork_test.go +++ b/netdeploy/remote/deployedNetwork_test.go @@ -24,11 +24,11 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestCreateSignedTx(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var networkState netState networkState.nApplications = 2 @@ -115,7 +115,7 @@ func TestCreateSignedTx(t *testing.T) { } func TestAccountsNeeded(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) params := config.Consensus[protocol.ConsensusCurrentVersion] params.MaxAppsCreated = 10 diff --git a/network/connPerfMon_test.go b/network/connPerfMon_test.go index 8adc174a17..401b7d3bab 100644 --- a/network/connPerfMon_test.go +++ b/network/connPerfMon_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func makeMsgPool(N int, peers []Peer) (out []IncomingMessage) { @@ -93,7 +93,7 @@ func BenchmarkConnMonitor(b *testing.B) { } func TestConnMonitorStageTiming(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) peers := []Peer{&wsPeer{}, &wsPeer{}, &wsPeer{}, &wsPeer{}} msgPool := makeMsgPool(60000, peers) @@ -131,7 +131,7 @@ func TestConnMonitorStageTiming(t *testing.T) { } func TestBucketsPruning(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) bucketsCount := 100 curTime := time.Now().UnixNano() diff --git a/network/limited_reader_slurper_test.go b/network/limited_reader_slurper_test.go index d6feb2d5cb..e13fcacce6 100644 --- a/network/limited_reader_slurper_test.go +++ b/network/limited_reader_slurper_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLimitedReaderSlurper(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for _, arraySize := range []uint64{30000, 90000, 200000} { // create a random bytes array. @@ -79,7 +79,7 @@ func (f *fuzzReader) Read(b []byte) (n int, err error) { } func TestLimitedReaderSlurper_FuzzedBlippedSource(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) arraySize := uint64(300000) bytesBlob := make([]byte, arraySize) @@ -126,7 +126,7 @@ func BenchmarkLimitedReaderSlurper(b *testing.B) { } func TestLimitedReaderSlurperMemoryConsumption(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for _, arraySize := range []uint64{1024, 2048, 65536, 1024 * 1024} { result := testing.Benchmark(func(b *testing.B) { @@ -137,7 +137,7 @@ func TestLimitedReaderSlurperMemoryConsumption(t *testing.T) { } func TestLimitedReaderSlurperBufferAllocations(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for baseAllocation := uint64(512); baseAllocation < 100000; baseAllocation += 2048 { for maxAllocation := uint64(512); maxAllocation < 100000; maxAllocation += 512 { diff --git a/network/msgOfInterest_test.go b/network/msgOfInterest_test.go index 6dc9a87bf4..ba3fe798b8 100644 --- a/network/msgOfInterest_test.go +++ b/network/msgOfInterest_test.go @@ -22,11 +22,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestUnmarshallMessageOfInterestErrors(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) tags, err := unmarshallMessageOfInterest([]byte{0x88}) require.Equal(t, errUnableUnmarshallMessage, err) @@ -49,7 +49,7 @@ func TestUnmarshallMessageOfInterestErrors(t *testing.T) { } func TestMarshallMessageOfInterest(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) bytes := MarshallMessageOfInterest([]protocol.Tag{protocol.AgreementVoteTag}) tags, err := unmarshallMessageOfInterest(bytes) diff --git a/network/multiplexer_test.go b/network/multiplexer_test.go index 1a9ebb0bc7..cd5bca0c21 100644 --- a/network/multiplexer_test.go +++ b/network/multiplexer_test.go @@ -24,7 +24,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func makeSignedTxnMsg() IncomingMessage { @@ -55,7 +55,7 @@ func (th *testHandler) SawMsg(msg IncomingMessage) bool { } func TestMultiplexer(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) m := MakeMultiplexer(logging.TestingLog(t)) handler := &testHandler{} diff --git a/network/phonebook_test.go b/network/phonebook_test.go index 1e688684b3..bd8e712bf6 100644 --- a/network/phonebook_test.go +++ b/network/phonebook_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -87,7 +87,7 @@ func testPhonebookUniform(t *testing.T, set []string, ph Phonebook, getsize int) } func TestArrayPhonebookAll(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) set := []string{"a", "b", "c", "d", "e"} ph := MakePhonebook(1, 1).(*phonebookImpl) @@ -98,7 +98,7 @@ func TestArrayPhonebookAll(t *testing.T) { } func TestArrayPhonebookUniform1(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) set := []string{"a", "b", "c", "d", "e"} ph := MakePhonebook(1, 1).(*phonebookImpl) @@ -109,7 +109,7 @@ func TestArrayPhonebookUniform1(t *testing.T) { } func TestArrayPhonebookUniform3(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) set := []string{"a", "b", "c", "d", "e"} ph := MakePhonebook(1, 1).(*phonebookImpl) @@ -122,7 +122,7 @@ func TestArrayPhonebookUniform3(t *testing.T) { // TestPhonebookExtension tests for extending different phonebooks with // addresses. func TestPhonebookExtension(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) setA := []string{"a"} moreB := []string{"b"} @@ -148,7 +148,7 @@ func extenderThread(th *phonebookImpl, more []string, wg *sync.WaitGroup, repeti } func TestThreadsafePhonebookExtension(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) set := []string{"a", "b", "c", "d", "e"} more := []string{"f", "g", "h", "i", "j"} @@ -174,7 +174,7 @@ func threadTestThreadsafePhonebookExtensionLong(wg *sync.WaitGroup, ph *phoneboo } func TestThreadsafePhonebookExtensionLong(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.SkipNow() @@ -196,7 +196,7 @@ func TestThreadsafePhonebookExtensionLong(t *testing.T) { } func TestMultiPhonebook(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) set := []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"} pha := make([]string, 0) @@ -217,7 +217,7 @@ func TestMultiPhonebook(t *testing.T) { } func TestMultiPhonebookDuplicateFiltering(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) set := []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"} pha := make([]string, 0) @@ -238,7 +238,7 @@ func TestMultiPhonebookDuplicateFiltering(t *testing.T) { } func TestWaitAndAddConnectionTimeLongtWindow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) entries := MakePhonebook(3, 200*time.Millisecond).(*phonebookImpl) addr1 := "addrABC" @@ -334,7 +334,7 @@ func TestWaitAndAddConnectionTimeLongtWindow(t *testing.T) { } func TestWaitAndAddConnectionTimeShortWindow(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) entries := MakePhonebook(3, 2*time.Millisecond).(*phonebookImpl) addr1 := "addrABC" @@ -388,7 +388,7 @@ func BenchmarkThreadsafePhonebook(b *testing.B) { // TestPhonebookRoles tests that the filtering by roles for different // phonebooks entries works as expected. func TestPhonebookRoles(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) relaysSet := []string{"relay1", "relay2", "relay3"} archiverSet := []string{"archiver1", "archiver2", "archiver3"} diff --git a/network/ping_test.go b/network/ping_test.go index 1abc906a55..85b1ef2c3a 100644 --- a/network/ping_test.go +++ b/network/ping_test.go @@ -20,13 +20,13 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) // for two node network, check that B can ping A and get a reply func TestPing(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 diff --git a/network/requestLogger_test.go b/network/requestLogger_test.go index 430760e330..f65099dc3f 100644 --- a/network/requestLogger_test.go +++ b/network/requestLogger_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/logging/telemetryspec" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type eventsDetailsLogger struct { @@ -43,7 +43,7 @@ func (dl eventsDetailsLogger) EventWithDetails(category telemetryspec.Category, // for two node network, check that B can ping A and get a reply func TestRequestLogger(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) log := logging.TestingLog(t) dl := eventsDetailsLogger{Logger: log, eventReceived: make(chan interface{}, 1), eventIdentifier: telemetryspec.HTTPRequestEvent} diff --git a/network/requestTracker_test.go b/network/requestTracker_test.go index b0585d6765..0016969fa2 100644 --- a/network/requestTracker_test.go +++ b/network/requestTracker_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func (ard *hostIncomingRequests) remove(trackedRequest *TrackerRequest) { @@ -38,7 +38,7 @@ func (ard *hostIncomingRequests) remove(trackedRequest *TrackerRequest) { } } func TestHostIncomingRequestsOrdering(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if defaultConfig.ConnectionsRateLimitingCount == 0 || defaultConfig.ConnectionsRateLimitingWindowSeconds == 0 { t.Skip() @@ -73,7 +73,7 @@ func TestHostIncomingRequestsOrdering(t *testing.T) { } func TestRateLimiting(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if defaultConfig.ConnectionsRateLimitingCount == 0 || defaultConfig.ConnectionsRateLimitingWindowSeconds == 0 { t.Skip() @@ -171,7 +171,7 @@ func TestRateLimiting(t *testing.T) { } func TestIsLocalHost(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) require.True(t, isLocalhost("localhost")) require.True(t, isLocalhost("127.0.0.1")) diff --git a/network/topics_test.go b/network/topics_test.go index 49330d4dc4..a98d21f2a1 100644 --- a/network/topics_test.go +++ b/network/topics_test.go @@ -21,13 +21,13 @@ import ( "fmt" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) // Test the marshall/unmarshall of Topics func TestTopics(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) topics := Topics{ Topic{ @@ -71,7 +71,7 @@ func TestTopics(t *testing.T) { // TestCurruptedTopics checks the errors // Makes sure UnmarshallTopics will not attempt to read beyond the buffer limits func TestCurruptedTopics(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var buffer []byte diff --git a/network/wsNetwork_test.go b/network/wsNetwork_test.go index 05842c6eb4..55f1e33a5d 100644 --- a/network/wsNetwork_test.go +++ b/network/wsNetwork_test.go @@ -44,7 +44,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/logging/telemetryspec" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util" "github.com/algorand/go-algorand/util/metrics" ) @@ -202,7 +202,7 @@ func newMessageCounter(t testing.TB, target int) *messageCounterHandler { } func TestWebsocketNetworkStartStop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.Start() @@ -222,7 +222,7 @@ func waitReady(t testing.TB, wn *WebsocketNetwork, timeout <-chan time.Time) boo // Set up two nodes, test that a.Broadcast is received by B func TestWebsocketNetworkBasic(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -258,7 +258,7 @@ func TestWebsocketNetworkBasic(t *testing.T) { // Repeat basic, but test a unicast func TestWebsocketNetworkUnicast(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -299,7 +299,7 @@ func TestWebsocketNetworkUnicast(t *testing.T) { // Like a basic test, but really we just want to have SetPeerData()/GetPeerData() func TestWebsocketPeerData(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -337,7 +337,7 @@ func TestWebsocketPeerData(t *testing.T) { // Test sending array of messages func TestWebsocketNetworkArray(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -374,7 +374,7 @@ func TestWebsocketNetworkArray(t *testing.T) { // Test cancelling message sends func TestWebsocketNetworkCancel(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -457,7 +457,7 @@ func TestWebsocketNetworkCancel(t *testing.T) { // Set up two nodes, test that a.Broadcast is received by B, when B has no address. func TestWebsocketNetworkNoAddress(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -549,7 +549,7 @@ const lineNetworkNumMessages = 5 // Bonus! Measure how long that takes. // TODO: also make a Benchmark version of this that reports per-node broadcast hop speed. func TestLineNetwork(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) nodes, counters := lineNetwork(t, lineNetworkLength) t.Logf("line network length: %d", lineNetworkLength) @@ -585,7 +585,7 @@ func addrtest(t *testing.T, wn *WebsocketNetwork, expected, src string) { } func TestAddrToGossipAddr(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) wn := &WebsocketNetwork{} wn.GenesisID = "test genesisID" @@ -619,7 +619,7 @@ var nopConnSingleton = nopConn{} // What happens when all the read message handler threads get busy? func TestSlowHandlers(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) slowTag := protocol.Tag("sl") fastTag := protocol.Tag("fa") @@ -695,7 +695,7 @@ func TestSlowHandlers(t *testing.T) { // one peer sends waaaayy too much slow-to-handle traffic. everything else should run fine. func TestFloodingPeer(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("flaky test") slowTag := protocol.Tag("sl") @@ -790,7 +790,7 @@ func avgSendBufferHighPrioLength(wn *WebsocketNetwork) float64 { // // This is a deeply invasive test that reaches into the guts of WebsocketNetwork and wsPeer. If the implementation chainges consider throwing away or totally reimplementing this test. func TestSlowOutboundPeer(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip() // todo - update this test to reflect the new implementation. xtag := protocol.ProposalPayloadTag @@ -876,7 +876,7 @@ func makeTestFilterWebsocketNode(t *testing.T, nodename string) *WebsocketNetwor } func TestDupFilter(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestFilterWebsocketNode(t, "a") netA.config.GossipFanout = 1 @@ -957,7 +957,7 @@ func TestDupFilter(t *testing.T) { } func TestGetPeers(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -1096,7 +1096,7 @@ func BenchmarkWebsocketNetworkBasic(t *testing.B) { // Check that priority is propagated from B to A func TestWebsocketNetworkPrio(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) prioA := netPrioStub{} netA := makeTestWebsocketNode(t) @@ -1138,7 +1138,7 @@ func TestWebsocketNetworkPrio(t *testing.T) { // Check that priority is propagated from B to A func TestWebsocketNetworkPrioLimit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) limitConf := defaultConfig limitConf.BroadcastConnectionsLimit = 1 @@ -1226,7 +1226,7 @@ func TestWebsocketNetworkPrioLimit(t *testing.T) { // Create many idle connections, to see if we have excessive CPU utilization. func TestWebsocketNetworkManyIdle(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // This test is meant to be run manually, as: // @@ -1295,7 +1295,7 @@ func TestWebsocketNetworkManyIdle(t *testing.T) { // TODO: test funcion when some message handler is slow? func TestWebsocketNetwork_getCommonHeaders(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) header := http.Header{} expectedTelemetryGUID := "123" @@ -1311,7 +1311,7 @@ func TestWebsocketNetwork_getCommonHeaders(t *testing.T) { } func TestWebsocketNetwork_checkServerResponseVariables(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) wn := makeTestWebsocketNode(t) wn.GenesisID = "genesis-id1" @@ -1372,7 +1372,7 @@ func (wn *WebsocketNetwork) broadcastWithTimestamp(tag protocol.Tag, data []byte } func TestDelayedMessageDrop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -1411,7 +1411,7 @@ func TestDelayedMessageDrop(t *testing.T) { } func TestSlowPeerDisconnection(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) log := logging.TestingLog(t) log.SetLevel(logging.Info) @@ -1473,7 +1473,7 @@ func TestSlowPeerDisconnection(t *testing.T) { } func TestForceMessageRelaying(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) log := logging.TestingLog(t) log.SetLevel(logging.Level(defaultConfig.BaseLoggerDebugLevel)) @@ -1558,7 +1558,7 @@ func TestForceMessageRelaying(t *testing.T) { } func TestSetUserAgentHeader(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) headers := http.Header{} SetUserAgentHeader(headers) @@ -1567,7 +1567,7 @@ func TestSetUserAgentHeader(t *testing.T) { } func TestCheckProtocolVersionMatch(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // note - this test changes the SupportedProtocolVersions global variable ( SupportedProtocolVersions ) and therefore cannot be parallelized. originalSupportedProtocolVersions := SupportedProtocolVersions @@ -1648,7 +1648,7 @@ func handleTopicRequest(msg IncomingMessage) (out OutgoingMessage) { // Set up two nodes, test topics send/receive is working func TestWebsocketNetworkTopicRoundtrip(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var topicMsgReqTag Tag = protocol.UniEnsBlockReqTag netA := makeTestWebsocketNode(t) @@ -1704,7 +1704,7 @@ func TestWebsocketNetworkTopicRoundtrip(t *testing.T) { // Set up two nodes, have one of them request a certain message tag mask, and verify the other follow that. func TestWebsocketNetworkMessageOfInterest(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -1789,7 +1789,7 @@ func TestWebsocketNetworkMessageOfInterest(t *testing.T) { // Network B will respond with another message for the first 4 messages. When it receive the 5th message, it would close the connection. // We want to get an event with disconnectRequestReceived func TestWebsocketDisconnection(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) netA := makeTestWebsocketNode(t) netA.config.GossipFanout = 1 @@ -1878,7 +1878,7 @@ func TestWebsocketDisconnection(t *testing.T) { // TestASCIIFiltering tests the behaviour of filterASCII by feeding it with few known inputs and verifying the expected outputs. func TestASCIIFiltering(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testUnicodePrintableStrings := []struct { testString string @@ -1920,7 +1920,7 @@ func (cl callbackLogger) Warnf(s string, args ...interface{}) { // TestMaliciousCheckServerResponseVariables test the checkServerResponseVariables to ensure it doesn't print the a malicious input without being filtered to the log file. func TestMaliciousCheckServerResponseVariables(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) wn := makeTestWebsocketNode(t) wn.GenesisID = "genesis-id1" diff --git a/network/wsPeer_test.go b/network/wsPeer_test.go index cd51567d72..0570325b94 100644 --- a/network/wsPeer_test.go +++ b/network/wsPeer_test.go @@ -22,12 +22,12 @@ import ( "time" "unsafe" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestCheckSlowWritingPeer(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) now := time.Now() peer := wsPeer{ @@ -45,7 +45,7 @@ func TestCheckSlowWritingPeer(t *testing.T) { // TestGetRequestNonce tests if unique values are generated each time func TestGetRequestNonce(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numValues := 1000 peer := wsPeer{} @@ -79,7 +79,7 @@ func TestGetRequestNonce(t *testing.T) { } func TestDefaultMessageTagsLength(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for tag := range defaultSendMessageTags { require.Equal(t, 2, len(tag)) @@ -90,7 +90,7 @@ func TestDefaultMessageTagsLength(t *testing.T) { // offsets are 64-bit aligned. This is required due to go atomic library // limitation. func TestAtomicVariablesAligment(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) p := wsPeer{} require.True(t, (unsafe.Offsetof(p.requestNonce)%8) == 0) diff --git a/node/assemble_test.go b/node/assemble_test.go index ef4d50c6a1..9a6274504f 100644 --- a/node/assemble_test.go +++ b/node/assemble_test.go @@ -33,7 +33,7 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var genesisHash = crypto.Digest{0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe} @@ -173,7 +173,7 @@ func (cl callbackLogger) Warnf(s string, args ...interface{}) { } func TestAssembleBlockTransactionPoolBehind(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const numUsers = 100 expectingLog := false diff --git a/node/indexer/indexer_test.go b/node/indexer/indexer_test.go index 161fcd4eb9..ce767c6954 100644 --- a/node/indexer/indexer_test.go +++ b/node/indexer/indexer_test.go @@ -31,7 +31,7 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type IndexSuite struct { @@ -151,7 +151,7 @@ func (s *IndexSuite) TestIndexer_Asset() { } func TestExampleTestSuite(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) suite.Run(t, new(IndexSuite)) } diff --git a/node/msgp_gen_test.go b/node/msgp_gen_test.go index 9f393feb09..18f100ff33 100644 --- a/node/msgp_gen_test.go +++ b/node/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalnetPrioResponse(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := netPrioResponse{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalnetPrioResponse(t *testing.T) { } func TestRandomizedEncodingnetPrioResponse(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &netPrioResponse{}) } @@ -76,7 +76,7 @@ func BenchmarkUnmarshalnetPrioResponse(b *testing.B) { } func TestMarshalUnmarshalnetPrioResponseSigned(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := netPrioResponseSigned{} bts := v.MarshalMsg(nil) @@ -98,7 +98,7 @@ func TestMarshalUnmarshalnetPrioResponseSigned(t *testing.T) { } func TestRandomizedEncodingnetPrioResponseSigned(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &netPrioResponseSigned{}) } diff --git a/node/node_test.go b/node/node_test.go index e2b8a757db..20a744ad61 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -37,7 +37,7 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util" "github.com/algorand/go-algorand/util/db" "github.com/algorand/go-algorand/util/execpool" @@ -178,7 +178,7 @@ func setupFullNodes(t *testing.T, proto protocol.ConsensusVersion, verificationP } func TestSyncingFullNode(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("This is failing randomly again - PLEASE FIX!") @@ -237,7 +237,7 @@ func TestSyncingFullNode(t *testing.T) { } func TestInitialSync(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("flaky TestInitialSync ") @@ -272,7 +272,7 @@ func TestInitialSync(t *testing.T) { } func TestSimpleUpgrade(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("Randomly failing: node_test.go:~330 : no block notification for account. Re-enable after agreement bug-fix pass") @@ -423,7 +423,7 @@ func delayStartNode(node *AlgorandFullNode, peers []*AlgorandFullNode, delay tim } func TestStatusReport_TimeSinceLastRound(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type fields struct { LastRoundTimestamp time.Time @@ -481,7 +481,7 @@ func (m mismatchingDirectroyPermissionsLog) Errorf(fmts string, args ...interfac // TestMismatchingGenesisDirectoryPermissions tests to see that the os.MkDir check we have in MakeFull works as expected. It tests both the return error as well as the logged error. func TestMismatchingGenesisDirectoryPermissions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testDirectroy, err := ioutil.TempDir(os.TempDir(), t.Name()) require.NoError(t, err) diff --git a/node/topAccountListener_test.go b/node/topAccountListener_test.go index ce8e4f7baa..bcacd1ae90 100644 --- a/node/topAccountListener_test.go +++ b/node/topAccountListener_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // errorString is a trivial implementation of error. @@ -38,7 +38,7 @@ func (e *errorString) Error() string { } func TestUpdateTopAccounts(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var topN []basics.AccountDetail var input []basics.AccountDetail @@ -139,7 +139,7 @@ func TestUpdateTopAccounts(t *testing.T) { } func TestRemoveSome(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Initialize slice with 100 accounts var accountsSlice []basics.AccountDetail @@ -181,7 +181,7 @@ func TestRemoveSome(t *testing.T) { } func TestUpdate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) listener := topAccountListener{ accounts: []basics.AccountDetail{}, @@ -260,7 +260,7 @@ func TestUpdate(t *testing.T) { } func TestInit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) listener := makeTopAccountListener(logging.Base()) diff --git a/nodecontrol/algodControl_test.go b/nodecontrol/algodControl_test.go index c3347bd3c8..2349e9c450 100644 --- a/nodecontrol/algodControl_test.go +++ b/nodecontrol/algodControl_test.go @@ -20,12 +20,12 @@ import ( "errors" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestStopAlgodErrorNotRunning(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) nodeController := MakeNodeController("", ".") err := nodeController.StopAlgod() @@ -34,7 +34,7 @@ func TestStopAlgodErrorNotRunning(t *testing.T) { } func TestStopAlgodErrorInvalidDirectory(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) nodeController := MakeNodeController("", "[][]") err := nodeController.StopAlgod() diff --git a/protocol/codec_test.go b/protocol/codec_test.go index a8904d1ffb..221e14ceba 100644 --- a/protocol/codec_test.go +++ b/protocol/codec_test.go @@ -21,7 +21,7 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -55,7 +55,7 @@ type HelperStruct2 struct { } func TestOmitEmpty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var x TestStruct enc := EncodeReflect(&x) @@ -63,7 +63,7 @@ func TestOmitEmpty(t *testing.T) { } func TestEncodeOrder(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var a struct { A int @@ -122,7 +122,7 @@ type InlineParent struct { } func TestEncodeInline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := InlineChild{X: 5} b := InlineParent{InlineChild: a} @@ -136,7 +136,7 @@ type embeddedMsgp struct { } func TestEncodeEmbedded(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var x embeddedMsgp @@ -154,7 +154,7 @@ func TestEncodeEmbedded(t *testing.T) { } func TestEncodeJSON(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type ar []string type mp struct { diff --git a/protocol/transcode/core_test.go b/protocol/transcode/core_test.go index d7134cfe04..330ea66554 100644 --- a/protocol/transcode/core_test.go +++ b/protocol/transcode/core_test.go @@ -27,7 +27,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func transcodeNoError(t *testing.T, mpToJSON bool, in io.ReadCloser, out io.WriteCloser) { @@ -165,7 +165,7 @@ func randomMap(width int, depth int) interface{} { } func TestIdempotence(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) niter := 10000 if testing.Short() { @@ -179,7 +179,7 @@ func TestIdempotence(t *testing.T) { } func TestIdempotenceMultiobject(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) niter := 1000 if testing.Short() { @@ -216,7 +216,7 @@ type parentStruct struct { } func TestIdempotenceStruct(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) niter := 10000 if testing.Short() { diff --git a/rpcs/blockService_test.go b/rpcs/blockService_test.go index be27808e32..3269f5c139 100644 --- a/rpcs/blockService_test.go +++ b/rpcs/blockService_test.go @@ -33,7 +33,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type mockUnicastPeer struct { @@ -59,7 +59,7 @@ func (mup *mockUnicastPeer) Respond(ctx context.Context, reqMsg network.Incoming // TestHandleCatchupReqNegative covers the error reporting in handleCatchupReq func TestHandleCatchupReqNegative(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) reqMsg := network.IncomingMessage{ Sender: &mockUnicastPeer{}, @@ -114,7 +114,7 @@ func TestHandleCatchupReqNegative(t *testing.T) { // TestRedirectBasic tests the case when the block service redirects the request to elsewhere func TestRedirectFallbackArchiver(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) log := logging.TestingLog(t) @@ -168,7 +168,7 @@ func TestRedirectFallbackArchiver(t *testing.T) { // TestRedirectBasic tests the case when the block service redirects the request to elsewhere func TestRedirectFallbackEndpoints(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) log := logging.TestingLog(t) @@ -222,7 +222,7 @@ func TestRedirectFallbackEndpoints(t *testing.T) { // - the case when the peer is not a valid http peer // - the case when the block service keeps redirecting and cannot get a block func TestRedirectExceptions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) log := logging.TestingLog(t) diff --git a/rpcs/msgp_gen_test.go b/rpcs/msgp_gen_test.go index 80f6a2ce50..f08f73d7c0 100644 --- a/rpcs/msgp_gen_test.go +++ b/rpcs/msgp_gen_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalEncodedBlockCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) v := EncodedBlockCert{} bts := v.MarshalMsg(nil) @@ -35,7 +35,7 @@ func TestMarshalUnmarshalEncodedBlockCert(t *testing.T) { } func TestRandomizedEncodingEncodedBlockCert(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) protocol.RunEncodingTest(t, &EncodedBlockCert{}) } diff --git a/rpcs/txService_test.go b/rpcs/txService_test.go index afb446bb4f..fd92b83a10 100644 --- a/rpcs/txService_test.go +++ b/rpcs/txService_test.go @@ -34,7 +34,7 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/bloom" ) @@ -133,7 +133,7 @@ func nodePair() (*basicRPCNode, *basicRPCNode) { } func TestTxSync(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // A network with two nodes, A and B nodeA, nodeB := nodePair() diff --git a/rpcs/txSyncer_test.go b/rpcs/txSyncer_test.go index 7a1281428f..c141eb7bb3 100644 --- a/rpcs/txSyncer_test.go +++ b/rpcs/txSyncer_test.go @@ -36,7 +36,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/bloom" ) @@ -164,7 +164,7 @@ func makeMockClientAggregator(t *testing.T, failWithNil bool, failWithError bool } func TestSyncFromClient(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) clientPool := makeMockPendingTxAggregate(2) serverPool := makeMockPendingTxAggregate(1) @@ -180,7 +180,7 @@ func TestSyncFromClient(t *testing.T) { } func TestSyncFromUnsupportedClient(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pool := makeMockPendingTxAggregate(3) runner := mockRunner{failWithNil: true, failWithError: false, txgroups: pool.PendingTxGroups()[len(pool.PendingTxGroups())-1:], done: make(chan *rpc.Call)} @@ -195,7 +195,7 @@ func TestSyncFromUnsupportedClient(t *testing.T) { } func TestSyncFromClientAndQuit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pool := makeMockPendingTxAggregate(3) runner := mockRunner{failWithNil: false, failWithError: false, txgroups: pool.PendingTxGroups()[len(pool.PendingTxGroups())-1:], done: make(chan *rpc.Call)} @@ -210,7 +210,7 @@ func TestSyncFromClientAndQuit(t *testing.T) { } func TestSyncFromClientAndError(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pool := makeMockPendingTxAggregate(3) runner := mockRunner{failWithNil: false, failWithError: true, txgroups: pool.PendingTxGroups()[len(pool.PendingTxGroups())-1:], done: make(chan *rpc.Call)} @@ -224,7 +224,7 @@ func TestSyncFromClientAndError(t *testing.T) { } func TestSyncFromClientAndTimeout(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pool := makeMockPendingTxAggregate(3) runner := mockRunner{failWithNil: false, failWithError: false, txgroups: pool.PendingTxGroups()[len(pool.PendingTxGroups())-1:], done: make(chan *rpc.Call)} @@ -239,7 +239,7 @@ func TestSyncFromClientAndTimeout(t *testing.T) { } func TestSync(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pool := makeMockPendingTxAggregate(1) nodeA := basicRPCNode{} @@ -261,7 +261,7 @@ func TestSync(t *testing.T) { } func TestNoClientsSync(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pool := makeMockPendingTxAggregate(3) clientAgg := mockClientAggregator{peers: []network.Peer{}} @@ -274,7 +274,7 @@ func TestNoClientsSync(t *testing.T) { } func TestStartAndStop(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("TODO: replace this test in new client paradigm") pool := makeMockPendingTxAggregate(3) @@ -305,7 +305,7 @@ func TestStartAndStop(t *testing.T) { } func TestStartAndQuit(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) pool := makeMockPendingTxAggregate(3) runner := mockRunner{failWithNil: false, failWithError: false, txgroups: pool.PendingTxGroups()[len(pool.PendingTxGroups())-1:], done: make(chan *rpc.Call)} diff --git a/test/commandandcontrol/cc_agent/component/agent_test.go b/test/commandandcontrol/cc_agent/component/agent_test.go index 1e5eeff685..0fb21f0dcf 100644 --- a/test/commandandcontrol/cc_agent/component/agent_test.go +++ b/test/commandandcontrol/cc_agent/component/agent_test.go @@ -19,12 +19,12 @@ package component import ( "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" ) func TestCommandStatus(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var start = START var completed = COMPLETED diff --git a/test/e2e-go/cli/algod/cleanup_test.go b/test/e2e-go/cli/algod/cleanup_test.go index 23df7847c0..ed8b8d0ddf 100644 --- a/test/e2e-go/cli/algod/cleanup_test.go +++ b/test/e2e-go/cli/algod/cleanup_test.go @@ -24,11 +24,11 @@ import ( "github.com/algorand/go-algorand/nodecontrol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestNodeControllerCleanup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/cli/algod/stdstreams_test.go b/test/e2e-go/cli/algod/stdstreams_test.go index 8756023f65..8e77ffd6cf 100644 --- a/test/e2e-go/cli/algod/stdstreams_test.go +++ b/test/e2e-go/cli/algod/stdstreams_test.go @@ -24,12 +24,12 @@ import ( "github.com/algorand/go-algorand/nodecontrol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util" ) func TestAlgodLogsToFile(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() diff --git a/test/e2e-go/features/catchup/basicCatchup_test.go b/test/e2e-go/features/catchup/basicCatchup_test.go index f75e265c30..ebb8870e2b 100644 --- a/test/e2e-go/features/catchup/basicCatchup_test.go +++ b/test/e2e-go/features/catchup/basicCatchup_test.go @@ -28,11 +28,11 @@ import ( "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestBasicCatchup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() @@ -79,7 +79,7 @@ func TestBasicCatchup(t *testing.T) { // TestCatchupOverGossip tests catchup across network versions // The current versions are the original v1 and the upgraded to v2.1 func TestCatchupOverGossip(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -200,7 +200,7 @@ const consensusTestUnupgradedProtocol = protocol.ConsensusVersion("test-unupgrad const consensusTestUnupgradedToProtocol = protocol.ConsensusVersion("test-unupgradedto-protocol") func TestStoppedCatchupOnUnsupported(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() diff --git a/test/e2e-go/features/catchup/catchpointCatchup_test.go b/test/e2e-go/features/catchup/catchpointCatchup_test.go index cc2cb7a8ee..3d1e35ef29 100644 --- a/test/e2e-go/features/catchup/catchpointCatchup_test.go +++ b/test/e2e-go/features/catchup/catchpointCatchup_test.go @@ -35,7 +35,7 @@ import ( "github.com/algorand/go-algorand/nodecontrol" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type nodeExitErrorCollector struct { @@ -80,7 +80,7 @@ func (ec *nodeExitErrorCollector) Print() { } func TestBasicCatchpointCatchup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() diff --git a/test/e2e-go/features/compactcert/compactcert_test.go b/test/e2e-go/features/compactcert/compactcert_test.go index 301e583575..e5f35c4fa6 100644 --- a/test/e2e-go/features/compactcert/compactcert_test.go +++ b/test/e2e-go/features/compactcert/compactcert_test.go @@ -32,11 +32,11 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/rpcs" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestCompactCerts(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("Disabling since they need work and shouldn't block releases") t.Parallel() diff --git a/test/e2e-go/features/multisig/multisig_test.go b/test/e2e-go/features/multisig/multisig_test.go index a340e8c67b..7e49586747 100644 --- a/test/e2e-go/features/multisig/multisig_test.go +++ b/test/e2e-go/features/multisig/multisig_test.go @@ -23,7 +23,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -32,7 +32,7 @@ import ( // try to transact with 2 sigs: expect success // try to transact with 3 sigs: expect success func TestBasicMultisig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -109,7 +109,7 @@ func TestBasicMultisig(t *testing.T) { // create a 0-of-3 multisig address: expect failure func TestZeroThreshold(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -138,7 +138,7 @@ func TestZeroThreshold(t *testing.T) { // create a 3-of-0 multisig address: expect failure func TestZeroSigners(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() @@ -163,7 +163,7 @@ func TestZeroSigners(t *testing.T) { // where the valid keys are all the same // then try to transact func TestDuplicateKeys(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() diff --git a/test/e2e-go/features/participation/onlineOfflineParticipation_test.go b/test/e2e-go/features/participation/onlineOfflineParticipation_test.go index bec87385b3..bcb2b55513 100644 --- a/test/e2e-go/features/participation/onlineOfflineParticipation_test.go +++ b/test/e2e-go/features/participation/onlineOfflineParticipation_test.go @@ -29,11 +29,11 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/e2e-go/globals" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestParticipationKeyOnlyAccountParticipatesCorrectly(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -107,7 +107,7 @@ func waitForAccountToProposeBlock(a *require.Assertions, fixture *fixtures.RestC // it should not be proposing blocks // - When the account balance receives enough stake, it should be proposing after lookback rounds func TestNewAccountCanGoOnlineAndParticipate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() } diff --git a/test/e2e-go/features/participation/overlappingParticipationKeys_test.go b/test/e2e-go/features/participation/overlappingParticipationKeys_test.go index 8e02c18e88..e3b9ca45bf 100644 --- a/test/e2e-go/features/participation/overlappingParticipationKeys_test.go +++ b/test/e2e-go/features/participation/overlappingParticipationKeys_test.go @@ -35,12 +35,12 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" ) func TestOverlappingParticipationKeys(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/features/participation/participationRewards_test.go b/test/e2e-go/features/participation/participationRewards_test.go index 989822c7fa..6faa5c7b39 100644 --- a/test/e2e-go/features/participation/participationRewards_test.go +++ b/test/e2e-go/features/participation/participationRewards_test.go @@ -28,7 +28,7 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func getFirstAccountFromNamedNode(fixture *fixtures.RestClientFixture, r *require.Assertions, nodeName string) (account string) { @@ -77,7 +77,7 @@ func spendToNonParticipating(t *testing.T, fixture *fixtures.RestClientFixture, } func TestOnlineOfflineRewards(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() r := require.New(fixtures.SynchronizedTest(t)) @@ -135,7 +135,7 @@ func TestOnlineOfflineRewards(t *testing.T) { } func TestPartkeyOnlyRewards(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if runtime.GOOS == "darwin" { t.Skip() @@ -186,7 +186,7 @@ func TestPartkeyOnlyRewards(t *testing.T) { } func TestRewardUnitThreshold(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() r := require.New(fixtures.SynchronizedTest(t)) @@ -307,7 +307,7 @@ func TestRewardUnitThreshold(t *testing.T) { var defaultPoolAddr = basics.Address{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} func TestRewardRateRecalculation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() r := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/features/partitionRecovery/partitionRecovery_test.go b/test/e2e-go/features/partitionRecovery/partitionRecovery_test.go index 69bf0d3321..7e78230939 100644 --- a/test/e2e-go/features/partitionRecovery/partitionRecovery_test.go +++ b/test/e2e-go/features/partitionRecovery/partitionRecovery_test.go @@ -24,14 +24,14 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) const partitionRecoveryTime = 20 * time.Minute // If we hit step 9, worst case recovery time can be ~2^8 * 5 ~= 20 mins const inducePartitionTime = 6 * time.Second // Try to minimize change of proceeding too many steps while stalled func TestBasicPartitionRecovery(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() @@ -77,7 +77,7 @@ func TestBasicPartitionRecovery(t *testing.T) { } func TestPartitionRecoverySwapStartup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() @@ -99,7 +99,7 @@ func TestPartitionRecoverySwapStartup(t *testing.T) { } func TestPartitionRecoveryStaggerRestart(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() @@ -162,7 +162,7 @@ func runTestWithStaggeredStopStart(t *testing.T, fixture *fixtures.RestClientFix } func TestBasicPartitionRecoveryPartOffline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() @@ -215,7 +215,7 @@ func TestBasicPartitionRecoveryPartOffline(t *testing.T) { } func TestPartitionHalfOffline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() diff --git a/test/e2e-go/features/teal/compile_test.go b/test/e2e-go/features/teal/compile_test.go index bf4e7fd03c..f042d318fe 100644 --- a/test/e2e-go/features/teal/compile_test.go +++ b/test/e2e-go/features/teal/compile_test.go @@ -25,11 +25,11 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTealCompile(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() diff --git a/test/e2e-go/features/transactions/accountv2_test.go b/test/e2e-go/features/transactions/accountv2_test.go index 7f2ea22ac8..a0b0db464e 100644 --- a/test/e2e-go/features/transactions/accountv2_test.go +++ b/test/e2e-go/features/transactions/accountv2_test.go @@ -31,7 +31,7 @@ import ( "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func checkEvalDelta(t *testing.T, client *libgoal.Client, startRnd, endRnd uint64, gval uint64, lval uint64) { @@ -76,7 +76,7 @@ func checkEvalDelta(t *testing.T, client *libgoal.Client, startRnd, endRnd uint6 } func TestAccountInformationV2(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/features/transactions/asset_test.go b/test/e2e-go/features/transactions/asset_test.go index ce58c15aef..ca09258f59 100644 --- a/test/e2e-go/features/transactions/asset_test.go +++ b/test/e2e-go/features/transactions/asset_test.go @@ -31,7 +31,7 @@ import ( "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type assetIDParams struct { @@ -54,7 +54,7 @@ func helperFillSignBroadcast(client libgoal.Client, wh []byte, sender string, tx } func TestAssetValidRounds(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -187,7 +187,7 @@ func TestAssetValidRounds(t *testing.T) { } func TestAssetConfig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() @@ -424,7 +424,7 @@ func TestAssetConfig(t *testing.T) { } func TestAssetInformation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -518,7 +518,7 @@ func TestAssetInformation(t *testing.T) { } func TestAssetGroupCreateSendDestroy(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -661,7 +661,7 @@ func TestAssetGroupCreateSendDestroy(t *testing.T) { } func TestAssetSend(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -910,7 +910,7 @@ func TestAssetSend(t *testing.T) { } func TestAssetCreateWaitRestartDelete(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a, fixture, client, account0 := setupTestAndNetwork(t, "", nil) defer fixture.Shutdown() @@ -973,7 +973,7 @@ func TestAssetCreateWaitRestartDelete(t *testing.T) { } func TestAssetCreateWaitBalLookbackDelete(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) if testing.Short() { t.Skip() diff --git a/test/e2e-go/features/transactions/close_account_test.go b/test/e2e-go/features/transactions/close_account_test.go index be1e852fce..a1be10b0be 100644 --- a/test/e2e-go/features/transactions/close_account_test.go +++ b/test/e2e-go/features/transactions/close_account_test.go @@ -23,11 +23,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestAccountsCanClose(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/features/transactions/group_test.go b/test/e2e-go/features/transactions/group_test.go index 432c580bef..47f30ffc00 100644 --- a/test/e2e-go/features/transactions/group_test.go +++ b/test/e2e-go/features/transactions/group_test.go @@ -27,11 +27,11 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestGroupTransactions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -103,7 +103,7 @@ func TestGroupTransactions(t *testing.T) { } func TestGroupTransactionsDifferentSizes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -211,7 +211,7 @@ func TestGroupTransactionsDifferentSizes(t *testing.T) { } func TestGroupTransactionsSubmission(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/features/transactions/lease_test.go b/test/e2e-go/features/transactions/lease_test.go index 31be1b2e30..3e96cee5cc 100644 --- a/test/e2e-go/features/transactions/lease_test.go +++ b/test/e2e-go/features/transactions/lease_test.go @@ -24,11 +24,11 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLeaseTransactionsSameSender(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -89,7 +89,7 @@ func TestLeaseTransactionsSameSender(t *testing.T) { } func TestLeaseRegressionFaultyFirstValidCheckOld_2f3880f7(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -163,7 +163,7 @@ func TestLeaseRegressionFaultyFirstValidCheckOld_2f3880f7(t *testing.T) { } func TestLeaseRegressionFaultyFirstValidCheckNew_2f3880f7(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -224,7 +224,7 @@ func TestLeaseRegressionFaultyFirstValidCheckNew_2f3880f7(t *testing.T) { } func TestLeaseTransactionsSameSenderDifferentLease(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -287,7 +287,7 @@ func TestLeaseTransactionsSameSenderDifferentLease(t *testing.T) { } func TestLeaseTransactionsDifferentSender(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -363,7 +363,7 @@ func TestLeaseTransactionsDifferentSender(t *testing.T) { } func TestOverlappingLeases(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/features/transactions/onlineStatusChange_test.go b/test/e2e-go/features/transactions/onlineStatusChange_test.go index 5630b6df67..d4f153fc1c 100644 --- a/test/e2e-go/features/transactions/onlineStatusChange_test.go +++ b/test/e2e-go/features/transactions/onlineStatusChange_test.go @@ -24,20 +24,20 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) const transactionValidityPeriod = uint64(100) // rounds const transactionFee = uint64(0) func TestAccountsCanChangeOnlineState(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testAccountsCanChangeOnlineState(t, filepath.Join("nettemplates", "TwoNodesPartlyOffline.json")) } func TestAccountsCanChangeOnlineStateInTheFuture(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testAccountsCanChangeOnlineState(t, filepath.Join("nettemplates", "TwoNodesPartlyOfflineVFuture.json")) } diff --git a/test/e2e-go/features/transactions/proof_test.go b/test/e2e-go/features/transactions/proof_test.go index 06668cc36e..76c144dd5d 100644 --- a/test/e2e-go/features/transactions/proof_test.go +++ b/test/e2e-go/features/transactions/proof_test.go @@ -26,11 +26,11 @@ import ( "github.com/algorand/go-algorand/crypto/merklearray" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTxnMerkleProof(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/features/transactions/sendReceive_test.go b/test/e2e-go/features/transactions/sendReceive_test.go index 7b53d772d4..0c0ac5cf65 100644 --- a/test/e2e-go/features/transactions/sendReceive_test.go +++ b/test/e2e-go/features/transactions/sendReceive_test.go @@ -25,7 +25,7 @@ import ( v1 "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func GenerateRandomBytes(n int) []byte { @@ -42,7 +42,7 @@ func GenerateRandomBytes(n int) []byte { // this test checks that two accounts' balances stay up to date // as they send each other money many times func TestAccountsCanSendMoney(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numberOfSends := 25 if testing.Short() { diff --git a/test/e2e-go/kmd/e2e_kmd_server_client_test.go b/test/e2e-go/kmd/e2e_kmd_server_client_test.go index ae100a1302..3aa417558f 100644 --- a/test/e2e-go/kmd/e2e_kmd_server_client_test.go +++ b/test/e2e-go/kmd/e2e_kmd_server_client_test.go @@ -25,11 +25,11 @@ import ( "github.com/algorand/go-algorand/daemon/kmd/client" "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestServerStartsStopsSuccessfully(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -45,7 +45,7 @@ func TestServerStartsStopsSuccessfully(t *testing.T) { } func TestBadAuthFails(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) @@ -66,7 +66,7 @@ func TestBadAuthFails(t *testing.T) { } func TestGoodAuthSucceeds(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() diff --git a/test/e2e-go/kmd/e2e_kmd_sqlite_test.go b/test/e2e-go/kmd/e2e_kmd_sqlite_test.go index c05a2d4067..a724e1e281 100644 --- a/test/e2e-go/kmd/e2e_kmd_sqlite_test.go +++ b/test/e2e-go/kmd/e2e_kmd_sqlite_test.go @@ -23,11 +23,11 @@ import ( "github.com/algorand/go-algorand/daemon/kmd/config" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestNonAbsSQLiteWalletConfigFails(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -45,7 +45,7 @@ func TestNonAbsSQLiteWalletConfigFails(t *testing.T) { } func TestAbsSQLiteWalletConfigSucceeds(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() diff --git a/test/e2e-go/kmd/e2e_kmd_wallet_keyops_test.go b/test/e2e-go/kmd/e2e_kmd_wallet_keyops_test.go index a1b146ded3..18c7f6d105 100644 --- a/test/e2e-go/kmd/e2e_kmd_wallet_keyops_test.go +++ b/test/e2e-go/kmd/e2e_kmd_wallet_keyops_test.go @@ -29,11 +29,11 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestGenerateAndListKeys(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -87,7 +87,7 @@ func TestGenerateAndListKeys(t *testing.T) { } func TestImportKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -139,7 +139,7 @@ func TestImportKey(t *testing.T) { } func TestExportKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -203,7 +203,7 @@ func TestExportKey(t *testing.T) { } func TestDeleteKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -269,7 +269,7 @@ func TestDeleteKey(t *testing.T) { } func TestSignTransaction(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -329,7 +329,7 @@ func TestSignTransaction(t *testing.T) { } func TestSignProgram(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -430,7 +430,7 @@ func BenchmarkSignTransaction(b *testing.B) { } func TestMasterKeyImportExport(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -599,7 +599,7 @@ func TestMasterKeyImportExport(t *testing.T) { } func TestMasterKeyGeneratePastImportedKeys(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() diff --git a/test/e2e-go/kmd/e2e_kmd_wallet_multisig_test.go b/test/e2e-go/kmd/e2e_kmd_wallet_multisig_test.go index 8fe30fe6a8..95598721de 100644 --- a/test/e2e-go/kmd/e2e_kmd_wallet_multisig_test.go +++ b/test/e2e-go/kmd/e2e_kmd_wallet_multisig_test.go @@ -29,7 +29,7 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func addrToPK(t *testing.T, addr string) crypto.PublicKey { @@ -40,7 +40,7 @@ func addrToPK(t *testing.T, addr string) crypto.PublicKey { } func TestMultisigImportList(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -89,7 +89,7 @@ func TestMultisigImportList(t *testing.T) { } func TestMultisigExportDelete(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -161,7 +161,7 @@ func TestMultisigExportDelete(t *testing.T) { } func TestMultisigSign(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -236,7 +236,7 @@ func TestMultisigSign(t *testing.T) { } func TestMultisigSignWithSigner(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -318,7 +318,7 @@ func TestMultisigSignWithSigner(t *testing.T) { } func TestMultisigSignWithWrongSigner(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -377,7 +377,7 @@ func TestMultisigSignWithWrongSigner(t *testing.T) { } func TestMultisigSignProgram(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() diff --git a/test/e2e-go/kmd/e2e_kmd_wallet_test.go b/test/e2e-go/kmd/e2e_kmd_wallet_test.go index 782a06096e..26eabc0e84 100644 --- a/test/e2e-go/kmd/e2e_kmd_wallet_test.go +++ b/test/e2e-go/kmd/e2e_kmd_wallet_test.go @@ -24,11 +24,11 @@ import ( "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestWalletCreation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -80,7 +80,7 @@ func TestWalletCreation(t *testing.T) { } func TestBlankWalletCreation(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -115,7 +115,7 @@ func TestBlankWalletCreation(t *testing.T) { } func TestWalletRename(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -195,7 +195,7 @@ func TestWalletRename(t *testing.T) { } func TestWalletSessionRelease(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -237,7 +237,7 @@ func TestWalletSessionRelease(t *testing.T) { } func TestWalletSessionRenew(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() @@ -285,7 +285,7 @@ func TestWalletSessionRenew(t *testing.T) { } func TestWalletSessionExpiry(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) t.Parallel() diff --git a/test/e2e-go/restAPI/restClient_test.go b/test/e2e-go/restAPI/restClient_test.go index 1cd81671c1..3c3faa2d0d 100644 --- a/test/e2e-go/restAPI/restClient_test.go +++ b/test/e2e-go/restAPI/restClient_test.go @@ -42,7 +42,7 @@ import ( "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) var fixture fixtures.RestClientFixture @@ -187,7 +187,7 @@ func waitForTransaction(t *testing.T, testClient libgoal.Client, fromAddress, tx } func TestClientCanGetStatus(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -203,7 +203,7 @@ func TestClientCanGetStatus(t *testing.T) { } func TestClientCanGetStatusAfterBlock(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -218,7 +218,7 @@ func TestClientCanGetStatusAfterBlock(t *testing.T) { } func TestTransactionsByAddr(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) var localFixture fixtures.RestClientFixture @@ -266,7 +266,7 @@ func TestTransactionsByAddr(t *testing.T) { } func TestClientCanGetVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -277,7 +277,7 @@ func TestClientCanGetVersion(t *testing.T) { } func TestClientCanGetSuggestedFee(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -288,7 +288,7 @@ func TestClientCanGetSuggestedFee(t *testing.T) { } func TestClientCanGetMinTxnFee(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -299,7 +299,7 @@ func TestClientCanGetMinTxnFee(t *testing.T) { } func TestClientCanGetBlockInfo(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -311,7 +311,7 @@ func TestClientCanGetBlockInfo(t *testing.T) { } func TestClientRejectsBadFromAddressWhenSending(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -327,7 +327,7 @@ func TestClientRejectsBadFromAddressWhenSending(t *testing.T) { } func TestClientRejectsBadToAddressWhenSending(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -343,7 +343,7 @@ func TestClientRejectsBadToAddressWhenSending(t *testing.T) { } func TestClientRejectsMutatedFromAddressWhenSending(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -366,7 +366,7 @@ func TestClientRejectsMutatedFromAddressWhenSending(t *testing.T) { } func TestClientRejectsMutatedToAddressWhenSending(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -389,7 +389,7 @@ func TestClientRejectsMutatedToAddressWhenSending(t *testing.T) { } func TestClientRejectsSendingMoneyFromAccountForWhichItHasNoKey(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -405,7 +405,7 @@ func TestClientRejectsSendingMoneyFromAccountForWhichItHasNoKey(t *testing.T) { } func TestClientOversizedNote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -430,7 +430,7 @@ func TestClientOversizedNote(t *testing.T) { } func TestClientCanSendAndGetNote(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -455,7 +455,7 @@ func TestClientCanSendAndGetNote(t *testing.T) { } func TestClientCanGetTransactionStatus(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -479,7 +479,7 @@ func TestClientCanGetTransactionStatus(t *testing.T) { } func TestAccountBalance(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -508,7 +508,7 @@ func TestAccountBalance(t *testing.T) { } func TestAccountParticipationInfo(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -571,7 +571,7 @@ func TestAccountParticipationInfo(t *testing.T) { } func TestSupply(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -584,7 +584,7 @@ func TestSupply(t *testing.T) { } func TestClientCanGetGoRoutines(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -598,7 +598,7 @@ func TestClientCanGetGoRoutines(t *testing.T) { } func TestSendingTooMuchFails(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -639,7 +639,7 @@ func TestSendingTooMuchFails(t *testing.T) { } func TestSendingFromEmptyAccountFails(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -678,7 +678,7 @@ func TestSendingFromEmptyAccountFails(t *testing.T) { } func TestSendingTooLittleToEmptyAccountFails(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -710,7 +710,7 @@ func TestSendingTooLittleToEmptyAccountFails(t *testing.T) { } func TestSendingLowFeeFails(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) defer fixture.SetTestContext(t)() @@ -745,7 +745,7 @@ func TestSendingLowFeeFails(t *testing.T) { } func TestSendingNotClosingAccountFails(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) // use a local fixture because we might really mess with the balances @@ -791,7 +791,7 @@ func TestSendingNotClosingAccountFails(t *testing.T) { } func TestClientCanGetPendingTransactions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) var localFixture fixtures.RestClientFixture @@ -824,7 +824,7 @@ func TestClientCanGetPendingTransactions(t *testing.T) { } func TestClientTruncatesPendingTransactions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) var localFixture fixtures.RestClientFixture @@ -865,7 +865,7 @@ func TestClientTruncatesPendingTransactions(t *testing.T) { } func TestClientPrioritizesPendingTransactions(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip("new FIFO pool does not have prioritization") a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/stress/transactions/createManyAndGoOnline_test.go b/test/e2e-go/stress/transactions/createManyAndGoOnline_test.go index 9e9a89a682..9e8ce85a69 100644 --- a/test/e2e-go/stress/transactions/createManyAndGoOnline_test.go +++ b/test/e2e-go/stress/transactions/createManyAndGoOnline_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func cascadeCreateAndFundAccounts(amountToSend, transactionFee uint64, fundingAccount string, client libgoal.Client, a *require.Assertions) map[string]string { @@ -49,7 +49,7 @@ func cascadeCreateAndFundAccounts(amountToSend, transactionFee uint64, fundingAc // this test creates many accounts // sends them all money, and sends them online func TestManyAccountsCanGoOnline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Parallel() a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/upgrades/application_support_test.go b/test/e2e-go/upgrades/application_support_test.go index 931a5731f7..6b0827b4e6 100644 --- a/test/e2e-go/upgrades/application_support_test.go +++ b/test/e2e-go/upgrades/application_support_test.go @@ -29,7 +29,7 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // consensusTestUnupgradedProtocol is a version of ConsensusCurrentVersion @@ -71,7 +71,7 @@ func makeApplicationUpgradeConsensus(t *testing.T) (appConsensus config.Consensu // to a version that supports applications. It verify that prior to supporting applications, the node would not accept // any application transaction and after the upgrade is complete, it would support that. func TestApplicationsUpgradeOverREST(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) smallLambdaMs := 500 consensus := makeApplicationUpgradeConsensus(t) @@ -301,7 +301,7 @@ int 1 // to a version that supports applications. It verify that prior to supporting applications, the node would not accept // any application transaction and after the upgrade is complete, it would support that. func TestApplicationsUpgradeOverGossip(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) smallLambdaMs := 500 diff --git a/test/e2e-go/upgrades/rekey_support_test.go b/test/e2e-go/upgrades/rekey_support_test.go index 64bbace834..b7c11284fc 100644 --- a/test/e2e-go/upgrades/rekey_support_test.go +++ b/test/e2e-go/upgrades/rekey_support_test.go @@ -27,12 +27,12 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestRekeyUpgrade tests that the rekey does not work before the upgrade and works well after func TestRekeyUpgrade(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(fixtures.SynchronizedTest(t)) diff --git a/test/e2e-go/upgrades/send_receive_upgrade_test.go b/test/e2e-go/upgrades/send_receive_upgrade_test.go index 16fc42786f..f7b58949ad 100644 --- a/test/e2e-go/upgrades/send_receive_upgrade_test.go +++ b/test/e2e-go/upgrades/send_receive_upgrade_test.go @@ -27,7 +27,7 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func GenerateRandomBytes(n int) []byte { @@ -44,31 +44,31 @@ func GenerateRandomBytes(n int) []byte { // this test checks that two accounts can send money to one another // across a protocol upgrade. func TestAccountsCanSendMoneyAcrossUpgradeV15toV16(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testAccountsCanSendMoneyAcrossUpgrade(t, filepath.Join("nettemplates", "TwoNodes50EachV15Upgrade.json")) } func TestAccountsCanSendMoneyAcrossUpgradeV21toV22(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testAccountsCanSendMoneyAcrossUpgrade(t, filepath.Join("nettemplates", "TwoNodes50EachV21Upgrade.json")) } func TestAccountsCanSendMoneyAcrossUpgradeV22toV23(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testAccountsCanSendMoneyAcrossUpgrade(t, filepath.Join("nettemplates", "TwoNodes50EachV22Upgrade.json")) } func TestAccountsCanSendMoneyAcrossUpgradeV23toV24(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testAccountsCanSendMoneyAcrossUpgrade(t, filepath.Join("nettemplates", "TwoNodes50EachV23Upgrade.json")) } func TestAccountsCanSendMoneyAcrossUpgradeV24toV25(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) testAccountsCanSendMoneyAcrossUpgrade(t, filepath.Join("nettemplates", "TwoNodes50EachV24Upgrade.json")) } diff --git a/test/framework/fixtures/expectFixture.go b/test/framework/fixtures/expectFixture.go index c4d450a81e..3620c1368e 100644 --- a/test/framework/fixtures/expectFixture.go +++ b/test/framework/fixtures/expectFixture.go @@ -28,7 +28,7 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -116,7 +116,7 @@ func (ef *ExpectFixture) Run() { for testName := range ef.expectFiles { if match, _ := regexp.MatchString(ef.testFilter, testName); match { ef.t.Run(testName, func(t *testing.T) { - testpartitioning.PartitionTest(t) // Check if this expect test should by run, may SKIP + partitiontest.PartitionTest(t) // Check if this expect test should by run, may SKIP syncTest := SynchronizedTest(t) workingDir, algoDir, err := ef.getTestDir(testName) diff --git a/testpartitioning/testFiltering.go b/test/partitiontest/filtering.go similarity index 74% rename from testpartitioning/testFiltering.go rename to test/partitiontest/filtering.go index 132760d512..74a263aaa2 100644 --- a/testpartitioning/testFiltering.go +++ b/test/partitiontest/filtering.go @@ -14,10 +14,12 @@ // You should have received a copy of the GNU Affero General Public License // along with go-algorand. If not, see . -package testpartitioning +package partitiontest import ( + "hash/fnv" "os" + "runtime" "strconv" "testing" ) @@ -38,16 +40,16 @@ func PartitionTest(t *testing.T) { return } name := t.Name() - nameNumber := stringToUint64(name) - if nameNumber%uint64(partitions) != uint64(partitionID) { - t.Skip() + _, file, _, _ := runtime.Caller(1) // get filename of caller to PartitionTest + nameNumber := stringToUint64(file + ":" + name) + idx := nameNumber % uint64(partitions) + if idx != uint64(partitionID) { + t.Skipf("skipping %s due to partitioning: assigned to %d but I am %d of %d", name, idx, partitionID, partitions) } } func stringToUint64(str string) uint64 { - sum := uint64(0) - for _, x := range str { - sum += uint64(x) - } - return sum + h := fnv.New64a() + h.Write([]byte(str)) + return h.Sum64() } diff --git a/tools/network/dnssec/anchor_test.go b/tools/network/dnssec/anchor_test.go index 349a81b47c..f953f222c8 100644 --- a/tools/network/dnssec/anchor_test.go +++ b/tools/network/dnssec/anchor_test.go @@ -19,12 +19,12 @@ package dnssec import ( "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestParseRootTrustAnchor(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) an1, err := makeRootTrustAnchor(rootAnchorXML) diff --git a/tools/network/dnssec/client_test.go b/tools/network/dnssec/client_test.go index 066dca0823..4d5e7e43ff 100644 --- a/tools/network/dnssec/client_test.go +++ b/tools/network/dnssec/client_test.go @@ -21,13 +21,13 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" ) func TestEmptyClient(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -59,7 +59,7 @@ func (t ttr) queryServer(ctx context.Context, server ResolverAddress, msg *dns.M } func TestMockedClient(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/tools/network/dnssec/config_test.go b/tools/network/dnssec/config_test.go index fcacc2b18a..a0e9ebb0c3 100644 --- a/tools/network/dnssec/config_test.go +++ b/tools/network/dnssec/config_test.go @@ -20,12 +20,12 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestConfigSystem(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) s, tm, err := SystemConfig() diff --git a/tools/network/dnssec/config_unix_test.go b/tools/network/dnssec/config_unix_test.go index 91f809c16b..f6ebe1bc12 100644 --- a/tools/network/dnssec/config_unix_test.go +++ b/tools/network/dnssec/config_unix_test.go @@ -23,12 +23,12 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestConfigEmpty(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -51,7 +51,7 @@ func TestConfigEmpty(t *testing.T) { } func TestConfig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/tools/network/dnssec/dnssec_test.go b/tools/network/dnssec/dnssec_test.go index f2168c7fb3..612ae12b1b 100644 --- a/tools/network/dnssec/dnssec_test.go +++ b/tools/network/dnssec/dnssec_test.go @@ -23,13 +23,13 @@ import ( "time" "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" ) func TestLookup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -216,7 +216,7 @@ func TestLookup(t *testing.T) { } func TestLookupAux(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -317,7 +317,7 @@ func TestLookupAux(t *testing.T) { } func TestDeadNS(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip() // skip real network tests in autotest a := require.New(t) @@ -336,7 +336,7 @@ func TestDeadNS(t *testing.T) { } func TestRealRequests(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip() // skip real network tests in autotest a := require.New(t) @@ -387,7 +387,7 @@ func TestRealRequests(t *testing.T) { } func TestDefaultResolver(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) r := MakeDefaultDnssecResolver("127.0.0.1", logging.Base()) diff --git a/tools/network/dnssec/sort_test.go b/tools/network/dnssec/sort_test.go index 664a5acd78..523c7325d7 100644 --- a/tools/network/dnssec/sort_test.go +++ b/tools/network/dnssec/sort_test.go @@ -20,12 +20,12 @@ import ( "net" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestSrvSort(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/tools/network/dnssec/trustedchain_test.go b/tools/network/dnssec/trustedchain_test.go index c5715930f6..9c541299e4 100644 --- a/tools/network/dnssec/trustedchain_test.go +++ b/tools/network/dnssec/trustedchain_test.go @@ -22,13 +22,13 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" ) func TestTrustChainBasic(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -60,7 +60,7 @@ func TestTrustChainBasic(t *testing.T) { } func TestEnsureTrustChain(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -275,7 +275,7 @@ func TestEnsureTrustChain(t *testing.T) { } func TestEnsureTrustChainFailures(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -326,7 +326,7 @@ func TestEnsureTrustChainFailures(t *testing.T) { } func TestAuthenticate(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -385,7 +385,7 @@ func TestAuthenticate(t *testing.T) { } func TestQueryWrapper(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/tools/network/dnssec/trustedzone_test.go b/tools/network/dnssec/trustedzone_test.go index f488340029..27759eee40 100644 --- a/tools/network/dnssec/trustedzone_test.go +++ b/tools/network/dnssec/trustedzone_test.go @@ -21,13 +21,13 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" ) func TestTrustedZone(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -101,7 +101,7 @@ func TestTrustedZone(t *testing.T) { } func TestMakeTrustedZone(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) @@ -193,7 +193,7 @@ func TestMakeTrustedZone(t *testing.T) { a.Empty(tzTest) } func TestVerifyRRSig(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) tt, _ := time.Parse(time.RFC3339, "2020-02-12T00:00:00Z") @@ -235,7 +235,7 @@ func TestVerifyRRSig(t *testing.T) { } func TestMatchKSKDigest(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/tools/network/dnssec/util_test.go b/tools/network/dnssec/util_test.go index a9f6e3984b..9f5ffa4c5f 100644 --- a/tools/network/dnssec/util_test.go +++ b/tools/network/dnssec/util_test.go @@ -19,12 +19,12 @@ package dnssec import ( "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestSplitZone(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) var res []string @@ -57,7 +57,7 @@ func TestSplitZone(t *testing.T) { } func TestParentZone(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) var res string diff --git a/tools/network/resolveController_test.go b/tools/network/resolveController_test.go index ee20451d8f..c30d3287cd 100644 --- a/tools/network/resolveController_test.go +++ b/tools/network/resolveController_test.go @@ -25,12 +25,12 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/tools/network/dnssec" ) func TestSystemResolver(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) log := logging.Base() @@ -46,7 +46,7 @@ func TestSystemResolver(t *testing.T) { } func TestFallbackResolver(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) log := logging.Base() @@ -63,7 +63,7 @@ func TestFallbackResolver(t *testing.T) { } func TestDefaultResolver(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) log := logging.Base() @@ -80,7 +80,7 @@ func TestDefaultResolver(t *testing.T) { } func TestRealNamesWithResolver(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Skip() // skip real network tests in autotest a := require.New(t) diff --git a/tools/network/resolver_test.go b/tools/network/resolver_test.go index 7f56bf1143..2021daa2cc 100644 --- a/tools/network/resolver_test.go +++ b/tools/network/resolver_test.go @@ -22,12 +22,12 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestResolver(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // start with a resolver that has no specific DNS address defined. // we want to make sure that it will go to the default DNS server ( 8.8.8.8 ) diff --git a/tools/network/telemetryURIUpdateService_test.go b/tools/network/telemetryURIUpdateService_test.go index a18eb0dcf5..b254d41573 100644 --- a/tools/network/telemetryURIUpdateService_test.go +++ b/tools/network/telemetryURIUpdateService_test.go @@ -25,7 +25,7 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) type telemetryURIUpdaterTest struct { @@ -59,7 +59,7 @@ func (t *telemetryURIUpdaterTest) add(protocol, bootstrap string, addrs []string } func TestTelemetryURILookup(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // trivial success case. uriUpdater := makeTelemetryURIUpdaterTest(config.Devnet) diff --git a/util/bloom/bloom_test.go b/util/bloom/bloom_test.go index fcf5250e7d..2380b8d877 100644 --- a/util/bloom/bloom_test.go +++ b/util/bloom/bloom_test.go @@ -16,11 +16,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestBitset(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) f := New(1024, 4, 1234) for i := uint32(0); i < 1024; i++ { @@ -35,7 +35,7 @@ func TestBitset(t *testing.T) { } func TestFilter(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) f := New(1024, 4, 1234) if f.Test([]byte("foo")) { @@ -48,7 +48,7 @@ func TestFilter(t *testing.T) { } func TestOptimal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numElementsCases := []int{2000, 20000, 200000} fpRateCases := []float64{0.001, 0.00001, 0.0000001} @@ -120,7 +120,7 @@ func (f *Filter) estimateFalsePositiveRate(numAdded uint32, numFP int) float64 { } func TestOptimalSize(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // These are the parameters we use in the Alpenhorn paper. numElements := 150000 @@ -134,7 +134,7 @@ func TestOptimalSize(t *testing.T) { } func TestIncompressible(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) numElements := 150000 numBits, numHashes := Optimal(numElements, 1e-10) @@ -156,7 +156,7 @@ func TestIncompressible(t *testing.T) { } func TestMarshalJSON(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) filter := New(1000, 6, 1234) filter.Set([]byte("hello")) @@ -198,7 +198,7 @@ func BenchmarkCreateLargeFilter(b *testing.B) { } func TestMaxHashes(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // These are the parameters we use in the Alpenhorn paper. numElements := 150000 @@ -237,7 +237,7 @@ func TestMaxHashes(t *testing.T) { // unmarshaled data stream, we can still call Test safely. If the unmarshaling fails, that's ok. // This test was implemented as an attempt to ensure that the data member is always non-empty. func TestEmptyFilter(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) blm := New(200, 16, 1234) marshaled, _ := blm.MarshalBinary() @@ -253,7 +253,7 @@ func TestEmptyFilter(t *testing.T) { // TestBinaryMarshalLength tests various sizes of bloom filters and ensures that the encoded binary // size is equal to the one reported by BinaryMarshalLength. func TestBinaryMarshalLength(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) for _, elementCount := range []int{2, 16, 1024, 32768, 5101, 100237, 144539} { for _, falsePositiveRate := range []float64{0.2, 0.1, 0.01, 0.001, 0.00001, 0.0000001} { @@ -270,7 +270,7 @@ func TestBinaryMarshalLength(t *testing.T) { } func TestBloomFilterMemoryConsumption(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Run("Set", func(t *testing.T) { N := 1000000 @@ -375,7 +375,7 @@ func BenchmarkBloomFilterTest(b *testing.B) { // TestBloomFilterReferenceHash ensure that we generate a bloom filter in a consistent way. This is important since we want to ensure that // this code is backward compatible. func TestBloomFilterReferenceHash(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) N := 3 sizeBits, numHashes := Optimal(N, 0.01) diff --git a/util/codecs/json_test.go b/util/codecs/json_test.go index fc5631f81d..432784a48a 100644 --- a/util/codecs/json_test.go +++ b/util/codecs/json_test.go @@ -17,7 +17,7 @@ package codecs import ( - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" "testing" ) @@ -29,7 +29,7 @@ type testValue struct { } func TestIsDefaultValue(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) a := require.New(t) diff --git a/util/db/dbutil_test.go b/util/db/dbutil_test.go index ada769267c..a675d3b846 100644 --- a/util/db/dbutil_test.go +++ b/util/db/dbutil_test.go @@ -33,11 +33,11 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestInMemoryDisposal(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) acc, err := MakeAccessor("fn.db", false, true) require.NoError(t, err) @@ -84,7 +84,7 @@ func TestInMemoryDisposal(t *testing.T) { } func TestInMemoryUniqueDB(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) acc, err := MakeAccessor("fn.db", false, true) require.NoError(t, err) @@ -118,7 +118,7 @@ func TestInMemoryUniqueDB(t *testing.T) { } func TestDBConcurrency(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) fn := fmt.Sprintf("/tmp/%s.%d.sqlite3", t.Name(), crypto.RandUint64()) defer cleanupSqliteDb(t, fn) @@ -236,7 +236,7 @@ func cleanupSqliteDb(t *testing.T, path string) { } func TestDBConcurrencyRW(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) dbFolder := "/dev/shm" os := runtime.GOOS @@ -360,7 +360,7 @@ func (wlc *WarningLogCounter) With(key string, value interface{}) logging.Logger // Test resetting warning notification func TestResettingTransactionWarnDeadline(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Run("expectedWarning", func(t *testing.T) { t.Parallel() @@ -399,7 +399,7 @@ func TestResettingTransactionWarnDeadline(t *testing.T) { // Test the SetSynchronousMode function func TestSetSynchronousMode(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) setSynchrounousModeHelper := func(mem bool, ctx context.Context, mode SynchronousMode, fullfsync bool) error { acc, err := MakeAccessor("fn.db", false, mem) @@ -436,7 +436,7 @@ func TestSetSynchronousMode(t *testing.T) { // it demonstrates that at any time before we're calling Commit, the database content can be read, and it's containing it's pre-transaction // value. func TestReadingWhileWriting(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) writeAcc, err := MakeAccessor("fn.db", false, false) require.NoError(t, err) diff --git a/util/db/versioning_test.go b/util/db/versioning_test.go index 6583b4791c..29b96eb230 100644 --- a/util/db/versioning_test.go +++ b/util/db/versioning_test.go @@ -22,7 +22,7 @@ import ( "os" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -90,7 +90,7 @@ func testVersioning(t *testing.T, inMemory bool) { } func TestVersioning(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) t.Run("InMem", func(t *testing.T) { testVersioning(t, true) }) t.Run("OnDisk", func(t *testing.T) { testVersioning(t, false) }) diff --git a/util/metrics/counter_test.go b/util/metrics/counter_test.go index dc59c254ce..67c7a07856 100644 --- a/util/metrics/counter_test.go +++ b/util/metrics/counter_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -31,7 +31,7 @@ type CounterTest struct { } func TestMetricCounter(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) test := &CounterTest{ MetricTest: NewMetricTest(), @@ -77,7 +77,7 @@ func TestMetricCounter(t *testing.T) { } func TestMetricCounterFastInts(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) test := &CounterTest{ MetricTest: NewMetricTest(), @@ -124,7 +124,7 @@ func TestMetricCounterFastInts(t *testing.T) { } func TestMetricCounterMixed(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) test := &CounterTest{ MetricTest: NewMetricTest(), diff --git a/util/metrics/gauge_test.go b/util/metrics/gauge_test.go index be0a75fc1c..1e1164b018 100644 --- a/util/metrics/gauge_test.go +++ b/util/metrics/gauge_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -32,7 +32,7 @@ type GaugeTest struct { } func TestMetricGauge(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) test := &GaugeTest{ MetricTest: NewMetricTest(), diff --git a/util/metrics/registry_test.go b/util/metrics/registry_test.go index 214ac55e3f..e4d8fc2d7f 100644 --- a/util/metrics/registry_test.go +++ b/util/metrics/registry_test.go @@ -22,12 +22,12 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestWriteAdd(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) // Test AddMetrics and WriteMetrics with a counter counter := MakeCounter(MetricName{Name: "gauge-name", Description: "gauge description"}) diff --git a/util/metrics/reporter_test.go b/util/metrics/reporter_test.go index b4a46950f2..cec86f63ec 100755 --- a/util/metrics/reporter_test.go +++ b/util/metrics/reporter_test.go @@ -19,12 +19,12 @@ package metrics import ( "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestParseNodeExporterArgs(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) passTestcases := map[string][]string{ "./node_exporter": {"./node_exporter", "--web.listen-address=:9100", "--web.telemetry-path=/metrics"}, // simple case diff --git a/util/metrics/segment_test.go b/util/metrics/segment_test.go index d99a07f1f0..d3590f5a68 100644 --- a/util/metrics/segment_test.go +++ b/util/metrics/segment_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -33,7 +33,7 @@ type SegmentTest struct { } func TestMetricSegment(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const initialSleepDuration = 10 * time.Millisecond const maxSleepDuration = 4 * time.Second diff --git a/util/metrics/stringGauge_test.go b/util/metrics/stringGauge_test.go index 6cba420888..1ea3650bc2 100644 --- a/util/metrics/stringGauge_test.go +++ b/util/metrics/stringGauge_test.go @@ -20,7 +20,7 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -30,7 +30,7 @@ func hasKey(data map[string]string, key string) bool { } func TestMetricStringGauge(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) stringGauge := MakeStringGauge() stringGauge.Set("number-key", "1") diff --git a/util/metrics/tagcounter_test.go b/util/metrics/tagcounter_test.go index 1ea32fd4b2..1e1c5b5aab 100644 --- a/util/metrics/tagcounter_test.go +++ b/util/metrics/tagcounter_test.go @@ -22,12 +22,12 @@ import ( "sync" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestTagCounter(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) tags := make([]string, 17) for i := range tags { diff --git a/util/s3/s3Helper_test.go b/util/s3/s3Helper_test.go index 4ea6e2d6ad..20406e7336 100644 --- a/util/s3/s3Helper_test.go +++ b/util/s3/s3Helper_test.go @@ -21,12 +21,12 @@ import ( "reflect" "testing" - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestGetS3UploadBucket(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) tests := []struct { name string @@ -53,7 +53,7 @@ func TestGetS3UploadBucket(t *testing.T) { } func TestGetS3ReleaseBucket(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) tests := []struct { name string @@ -80,7 +80,7 @@ func TestGetS3ReleaseBucket(t *testing.T) { } func Test_getS3Region(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) tests := []struct { name string @@ -107,7 +107,7 @@ func Test_getS3Region(t *testing.T) { } func TestMakeS3SessionForUploadWithBucket(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const bucket1 = "test-bucket" const publicUploadBucket = "algorand-uploads" @@ -151,7 +151,7 @@ func TestMakeS3SessionForUploadWithBucket(t *testing.T) { } func TestMakeS3SessionForDownloadWithBucket(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) const bucket1 = "test-bucket" const publicReleaseBucket = "algorand-releases" @@ -195,7 +195,7 @@ func TestMakeS3SessionForDownloadWithBucket(t *testing.T) { } func TestGetVersionFromName(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type args struct { name string @@ -219,7 +219,7 @@ func TestGetVersionFromName(t *testing.T) { } func TestGetPartsFromVersion(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) type args struct { name string diff --git a/util/timers/monotonic_test.go b/util/timers/monotonic_test.go index 568d55670b..115c702953 100644 --- a/util/timers/monotonic_test.go +++ b/util/timers/monotonic_test.go @@ -17,7 +17,7 @@ package timers import ( - "github.com/algorand/go-algorand/testpartitioning" + "github.com/algorand/go-algorand/test/partitiontest" "math/rand" "testing" "time" @@ -33,7 +33,7 @@ func polled(ch <-chan time.Time) bool { } func TestMonotonicDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var m Monotonic var c Clock @@ -59,7 +59,7 @@ func TestMonotonicDelta(t *testing.T) { } func TestMonotonicZeroDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var m Monotonic var c Clock @@ -73,7 +73,7 @@ func TestMonotonicZeroDelta(t *testing.T) { } func TestMonotonicNegativeDelta(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var m Monotonic var c Clock @@ -87,7 +87,7 @@ func TestMonotonicNegativeDelta(t *testing.T) { } func TestMonotonicZeroTwice(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) var m Monotonic var c Clock @@ -119,7 +119,7 @@ func TestMonotonicZeroTwice(t *testing.T) { } func TestMonotonicEncodeDecode(t *testing.T) { - testpartitioning.PartitionTest(t) + partitiontest.PartitionTest(t) singleTest := func(c Clock, descr string) { data := c.Encode()