Skip to content
Merged
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions agreement/pseudonode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,12 @@ func TestPseudonodeFailedEnqueuedTasks(t *testing.T) {
for i := 0; i < pseudonodeVerificationBacklog*2; i++ {
ch, err = pb.MakeProposals(context.Background(), startRound, period(i))
if err != nil {
require.Subset(t, []int{pseudonodeVerificationBacklog, pseudonodeVerificationBacklog + 1}, []int{i})
require.ErrorAs(t, errPseudonodeBacklogFull, &err)
break
}
channels = append(channels, ch)
}
enqueuedProposals := len(channels)
require.Error(t, err, "MakeProposals did not returned an error when being overflowed with requests")
require.True(t, errors.Is(err, errPseudonodeBacklogFull))

Expand All @@ -533,17 +534,17 @@ func TestPseudonodeFailedEnqueuedTasks(t *testing.T) {
for i := 0; i < pseudonodeVerificationBacklog*2; i++ {
ch, err = pb.MakeVotes(context.Background(), startRound, period(i), step(i%5), makeProposalValue(period(i), accounts[0].Address()), persist)
if err != nil {
require.Subset(t, []int{pseudonodeVerificationBacklog, pseudonodeVerificationBacklog + 1}, []int{i})
require.ErrorAs(t, errPseudonodeBacklogFull, &err)
break
}
channels = append(channels, ch)
}
require.Error(t, err, "MakeVotes did not returned an error when being overflowed with requests")

enqueuedVotes := len(channels) - enqueuedProposals
// drain output channels.
for _, ch := range channels {
drainChannel(ch)
}
require.Equal(t, 330, subStrLogger.instancesFound[0])
require.Equal(t, 330, subStrLogger.instancesFound[1])
require.Equal(t, enqueuedVotes*len(accounts), subStrLogger.instancesFound[0])
require.Equal(t, enqueuedProposals*len(accounts), subStrLogger.instancesFound[1])
}