Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lib/grandpa): include t.Parallel() to all lib/grandpa tests #2840

Merged
merged 59 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
88a4a0e
fix: improve sending vote messages and neighbor messages
EclesioMeloJunior Jul 22, 2022
9f073d6
chore: using `notifyNeighbor` goroutine func
EclesioMeloJunior Jul 22, 2022
499e552
chore: solve ci lint warns
EclesioMeloJunior Jul 22, 2022
66063cb
chore: solve `broadcastVotes` test helper to only broadcast `*VoteMes…
EclesioMeloJunior Jul 26, 2022
34b4a3d
chore: improve tests to neighbor messages
EclesioMeloJunior Jul 26, 2022
42b68bc
chore: solve lint warns
EclesioMeloJunior Jul 26, 2022
2b0c4e3
chore: improve not needed long for loop
EclesioMeloJunior Jul 26, 2022
3bad27e
chore: include unit tests
EclesioMeloJunior Jul 27, 2022
5f65292
chore: solve lint warns
EclesioMeloJunior Jul 27, 2022
3a418bc
chore: use incoming messages to decide when determine prevotes
EclesioMeloJunior Aug 11, 2022
0d8adec
fix: improve sending vote messages and neighbor messages
EclesioMeloJunior Jul 22, 2022
f5a0223
chore: using `notifyNeighbor` goroutine func
EclesioMeloJunior Jul 22, 2022
c23cff5
chore: solve ci lint warns
EclesioMeloJunior Jul 22, 2022
f21a428
chore: solve `broadcastVotes` test helper to only broadcast `*VoteMes…
EclesioMeloJunior Jul 26, 2022
71e4ce1
chore: improve tests to neighbor messages
EclesioMeloJunior Jul 26, 2022
397ce6d
chore: solve lint warns
EclesioMeloJunior Jul 26, 2022
3167c10
chore: improve not needed long for loop
EclesioMeloJunior Jul 26, 2022
bf39c24
chore: include unit tests
EclesioMeloJunior Jul 27, 2022
c9d9342
chore: solve lint warns
EclesioMeloJunior Jul 27, 2022
3561513
chore: use incoming messages to decide when determine prevotes
EclesioMeloJunior Aug 11, 2022
ecd6d93
chore: fix lint
EclesioMeloJunior Aug 15, 2022
8d79daa
Merge branch 'eclesio/fix/sending-votes-wrong-stage' of github.com:Ch…
EclesioMeloJunior Aug 15, 2022
075c070
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Aug 16, 2022
d15537c
chore: remove skip cache check when receive the same vote
EclesioMeloJunior Aug 16, 2022
7863b97
chore: resolve diffs and deltas
EclesioMeloJunior Aug 16, 2022
240070a
chore: resolve diffs and deltas
EclesioMeloJunior Aug 16, 2022
f540d91
chore: rename to `determinePrecommitCh`
EclesioMeloJunior Aug 16, 2022
053ee06
chore: stop `sendPrevoteMessage` once we reach the prevotes threshold
EclesioMeloJunior Aug 17, 2022
82730f0
chore: waits until round is finalizable
EclesioMeloJunior Aug 17, 2022
87c2dff
chore: remove `ctx` from goroutines and rely on `isFinalizableCh`
EclesioMeloJunior Aug 17, 2022
ec36847
chore: wip removing commit message
EclesioMeloJunior Aug 18, 2022
68dd6e8
chore: send commit message after round is finalizable
EclesioMeloJunior Aug 18, 2022
6eb34d4
Tim/fix/sending votes wrong stage (#2761)
timwu20 Aug 22, 2022
aef29de
wip: round_tests.go
EclesioMeloJunior Aug 23, 2022
bba4474
chore: wip tests
EclesioMeloJunior Aug 23, 2022
9b6dca3
chore: fixed tests to ensure we send messages in the right round
EclesioMeloJunior Aug 23, 2022
aff2de7
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Aug 24, 2022
5ddfd63
chore: solve lint wanrs
EclesioMeloJunior Aug 24, 2022
651926e
chore: skip lint `unparam`
EclesioMeloJunior Aug 24, 2022
af41370
chore: solve `varying chain` grandpa finalization test
EclesioMeloJunior Aug 29, 2022
41fa913
chore: solve all tests after `playGrandpaRound` refactor
EclesioMeloJunior Aug 30, 2022
b8d67e3
chore: solve lint warns
EclesioMeloJunior Aug 30, 2022
bf7a1a0
chore: solve lint warns
EclesioMeloJunior Aug 30, 2022
da7353b
chore: keep config.toml as development
EclesioMeloJunior Aug 31, 2022
ac55379
chore: fix test hanging due to unbuffered channel
EclesioMeloJunior Aug 31, 2022
a78577e
chore: improve error wrappings
EclesioMeloJunior Sep 8, 2022
5177a72
chore: solve lint warns
EclesioMeloJunior Sep 8, 2022
79f42c6
chore: solve main issues with finalization and tests
EclesioMeloJunior Sep 15, 2022
10343fe
chore: fix finalization issue on rpc tests with only one authority
EclesioMeloJunior Sep 15, 2022
ce4b103
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Sep 15, 2022
7c71d29
chore: solve `state_subscribeStorage` rpc test problems
EclesioMeloJunior Sep 15, 2022
ff6a0b8
Merge branch 'eclesio/fix/sending-votes-wrong-stage' of github.com:Ch…
EclesioMeloJunior Sep 15, 2022
98773ff
Merge branch 'development' into eclesio/fix/sending-votes-wrong-stage
EclesioMeloJunior Sep 15, 2022
a84b7c0
feat: introduce `t.Parallel()` to all `lib/grandpa` tests
EclesioMeloJunior Sep 16, 2022
475d366
Merge branch 'development' into eclesio/add-parallel-grandpa-test
EclesioMeloJunior Dec 5, 2022
60d55b0
Merge branch 'development' into eclesio/add-parallel-grandpa-test
EclesioMeloJunior Dec 5, 2022
4bf96a2
Merge branch 'development' into eclesio/add-parallel-grandpa-test
EclesioMeloJunior Dec 6, 2022
23b5ca3
chore: remove useless comments
EclesioMeloJunior Dec 6, 2022
75f2983
Merge branch 'eclesio/add-parallel-grandpa-test' of github.com:ChainS…
EclesioMeloJunior Dec 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/grandpa/grandpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ type Service struct {

// channels for communication with other services
finalisedCh chan *types.FinalisationInfo
//receivedCommit chan *CommitMessage

telemetry telemetry.Client
}
Expand Down
50 changes: 50 additions & 0 deletions lib/grandpa/grandpa_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
)

func TestUpdateAuthorities(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -50,6 +52,8 @@ func TestUpdateAuthorities(t *testing.T) {
}

func TestGetDirectVotes(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -87,6 +91,8 @@ func TestGetDirectVotes(t *testing.T) {
}

func TestGetVotesForBlock_NoDescendantVotes(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -127,6 +133,8 @@ func TestGetVotesForBlock_NoDescendantVotes(t *testing.T) {
}

func TestGetVotesForBlock_DescendantVotes(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -181,6 +189,8 @@ func TestGetVotesForBlock_DescendantVotes(t *testing.T) {
}

func TestGetPossibleSelectedAncestors_SameAncestor(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -239,6 +249,8 @@ func TestGetPossibleSelectedAncestors_SameAncestor(t *testing.T) {
}

func TestGetPossibleSelectedAncestors_VaryingAncestor(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -297,6 +309,8 @@ func TestGetPossibleSelectedAncestors_VaryingAncestor(t *testing.T) {
}

func TestGetPossibleSelectedAncestors_VaryingAncestor_MoreBranches(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -361,6 +375,8 @@ func TestGetPossibleSelectedAncestors_VaryingAncestor_MoreBranches(t *testing.T)
}

func TestGetPossibleSelectedBlocks_OneBlock(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -397,6 +413,8 @@ func TestGetPossibleSelectedBlocks_OneBlock(t *testing.T) {
}

func TestGetPossibleSelectedBlocks_EqualVotes_SameAncestor(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -448,6 +466,8 @@ func TestGetPossibleSelectedBlocks_EqualVotes_SameAncestor(t *testing.T) {
}

func TestGetPossibleSelectedBlocks_EqualVotes_VaryingAncestor(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -500,6 +520,8 @@ func TestGetPossibleSelectedBlocks_EqualVotes_VaryingAncestor(t *testing.T) {
}

func TestGetPossibleSelectedBlocks_OneThirdEquivocating(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -545,6 +567,8 @@ func TestGetPossibleSelectedBlocks_OneThirdEquivocating(t *testing.T) {
}

func TestGetPossibleSelectedBlocks_MoreThanOneThirdEquivocating(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -596,6 +620,8 @@ func TestGetPossibleSelectedBlocks_MoreThanOneThirdEquivocating(t *testing.T) {
}

func TestGetPreVotedBlock_OneBlock(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -631,6 +657,8 @@ func TestGetPreVotedBlock_OneBlock(t *testing.T) {
}

func TestGetPreVotedBlock_MultipleCandidates(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -681,6 +709,8 @@ func TestGetPreVotedBlock_MultipleCandidates(t *testing.T) {
}

func TestGetPreVotedBlock_EvenMoreCandidates(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -753,6 +783,8 @@ func TestGetPreVotedBlock_EvenMoreCandidates(t *testing.T) {
}

func TestFindParentWithNumber(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -818,6 +850,8 @@ func TestGetBestFinalCandidate_OneBlock(t *testing.T) {
}

func TestGetBestFinalCandidate_PrecommitAncestor(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -864,6 +898,8 @@ func TestGetBestFinalCandidate_PrecommitAncestor(t *testing.T) {
}

func TestGetBestFinalCandidate_NoPrecommit(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -904,6 +940,8 @@ func TestGetBestFinalCandidate_NoPrecommit(t *testing.T) {
}

func TestGetBestFinalCandidate_PrecommitOnAnotherChain(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -950,6 +988,8 @@ func TestGetBestFinalCandidate_PrecommitOnAnotherChain(t *testing.T) {
}

func TestDeterminePreVote_NoPrimaryPreVote(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand All @@ -966,6 +1006,8 @@ func TestDeterminePreVote_NoPrimaryPreVote(t *testing.T) {
}

func TestDeterminePreVote_WithPrimaryPreVote(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand All @@ -991,6 +1033,8 @@ func TestDeterminePreVote_WithPrimaryPreVote(t *testing.T) {
}

func TestDeterminePreVote_WithInvalidPrimaryPreVote(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand All @@ -1017,6 +1061,8 @@ func TestDeterminePreVote_WithInvalidPrimaryPreVote(t *testing.T) {
}

func TestGetGrandpaGHOST_CommonAncestor(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -1055,6 +1101,8 @@ func TestGetGrandpaGHOST_CommonAncestor(t *testing.T) {
}

func TestGetGrandpaGHOST_MultipleCandidates(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down Expand Up @@ -1108,6 +1156,8 @@ func TestGetGrandpaGHOST_MultipleCandidates(t *testing.T) {
}

func TestGrandpaServiceCreateJustification_ShouldCountEquivocatoryVotes(t *testing.T) {
t.Parallel()

kr, err := keystore.NewEd25519Keyring()
require.NoError(t, err)
aliceKeyPair := kr.Alice().(*ed25519.Keypair)
Expand Down
Loading