diff --git a/services/consensusalgo/benchmarkconsensus/test/handler_test.go b/services/consensusalgo/benchmarkconsensus/test/handler_test.go index f85f4cf42..a07ecdb0e 100644 --- a/services/consensusalgo/benchmarkconsensus/test/handler_test.go +++ b/services/consensusalgo/benchmarkconsensus/test/handler_test.go @@ -8,6 +8,7 @@ import ( ) func TestHandlerOfLeaderSynchronizesToFutureValidBlock(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -29,6 +30,7 @@ func TestHandlerOfLeaderSynchronizesToFutureValidBlock(t *testing.T) { } func TestHandlerOfNonLeaderSynchronizesToFutureValidBlock(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -54,6 +56,7 @@ func TestHandlerOfNonLeaderSynchronizesToFutureValidBlock(t *testing.T) { } func TestHandlerForBlockConsensusWithBadPrevBlockHashPointer(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -71,6 +74,7 @@ func TestHandlerForBlockConsensusWithBadPrevBlockHashPointer(t *testing.T) { } func TestHandlerForBlockConsensusWithBadSignature(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -92,6 +96,7 @@ func TestHandlerForBlockConsensusWithBadSignature(t *testing.T) { } func TestHandlerForBlockConsensusFromNonLeader(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) otherNonLeaderPublicKey, otherNonLeaderPrivateKey := otherNonLeaderKeyPair() diff --git a/services/consensusalgo/benchmarkconsensus/test/leader_test.go b/services/consensusalgo/benchmarkconsensus/test/leader_test.go index e01528c04..a0a898a3c 100644 --- a/services/consensusalgo/benchmarkconsensus/test/leader_test.go +++ b/services/consensusalgo/benchmarkconsensus/test/leader_test.go @@ -16,6 +16,7 @@ func newLeaderHarnessWaitingForCommittedMessages(t *testing.T, ctx context.Conte } func TestLeaderInit(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) @@ -25,6 +26,7 @@ func TestLeaderInit(t *testing.T) { } func TestLeaderCommitsConsecutiveBlocksAfterEnoughConfirmations(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) @@ -51,6 +53,7 @@ func TestLeaderCommitsConsecutiveBlocksAfterEnoughConfirmations(t *testing.T) { } func TestLeaderRetriesCommitOnErrorGeneratingBlock(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) @@ -75,6 +78,7 @@ func TestLeaderRetriesCommitOnErrorGeneratingBlock(t *testing.T) { } func TestLeaderRetriesCommitAfterNotEnoughConfirmations(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) @@ -101,6 +105,7 @@ func TestLeaderRetriesCommitAfterNotEnoughConfirmations(t *testing.T) { } func TestLeaderIgnoresBadCommittedMessageSignatures(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) @@ -117,6 +122,7 @@ func TestLeaderIgnoresBadCommittedMessageSignatures(t *testing.T) { } func TestLeaderIgnoresNonFederationSigners(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) @@ -133,6 +139,7 @@ func TestLeaderIgnoresNonFederationSigners(t *testing.T) { } func TestLeaderIgnoresOldConfirmations(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) @@ -158,6 +165,7 @@ func TestLeaderIgnoresOldConfirmations(t *testing.T) { } func TestLeaderIgnoresFutureConfirmations(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newLeaderHarnessWaitingForCommittedMessages(t, ctx) diff --git a/services/consensusalgo/benchmarkconsensus/test/non_leader_test.go b/services/consensusalgo/benchmarkconsensus/test/non_leader_test.go index 72462ef8e..aee6b86f0 100644 --- a/services/consensusalgo/benchmarkconsensus/test/non_leader_test.go +++ b/services/consensusalgo/benchmarkconsensus/test/non_leader_test.go @@ -16,6 +16,7 @@ func newNonLeaderHarness(t *testing.T, ctx context.Context) *harness { } func TestNonLeaderInit(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) @@ -24,6 +25,7 @@ func TestNonLeaderInit(t *testing.T) { } func TestNonLeaderDoesNotProposeBlocks(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newHarness(false) h.expectNewBlockProposalNotRequested() @@ -34,6 +36,7 @@ func TestNonLeaderDoesNotProposeBlocks(t *testing.T) { } func TestNonLeaderRepliesToGenesisBlockCommit(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -49,6 +52,7 @@ func TestNonLeaderRepliesToGenesisBlockCommit(t *testing.T) { } func TestNonLeaderSavesAndRepliesToConsecutiveBlockCommits(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -72,6 +76,7 @@ func TestNonLeaderSavesAndRepliesToConsecutiveBlockCommits(t *testing.T) { } func TestNonLeaderSavesAndRepliesToAnOldBlockCommit(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -102,6 +107,7 @@ func TestNonLeaderSavesAndRepliesToAnOldBlockCommit(t *testing.T) { } func TestNonLeaderIgnoresFutureBlockCommit(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -117,6 +123,7 @@ func TestNonLeaderIgnoresFutureBlockCommit(t *testing.T) { } func TestNonLeaderIgnoresBadPrevBlockHashPointer(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) aBlockFromLeader := builders.BlockPair().WithBenchmarkConsensusBlockProof(leaderPublicKey, leaderPrivateKey) @@ -140,6 +147,7 @@ func TestNonLeaderIgnoresBadPrevBlockHashPointer(t *testing.T) { } func TestNonLeaderIgnoresBadSignature(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx) @@ -157,6 +165,7 @@ func TestNonLeaderIgnoresBadSignature(t *testing.T) { } func TestNonLeaderIgnoresBlocksFromNonLeader(t *testing.T) { + t.Parallel() test.WithContext(func(ctx context.Context) { h := newNonLeaderHarness(t, ctx)