Skip to content

Commit

Permalink
Fix test timeout related to min connected peers (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
stana-miric committed May 1, 2023
1 parent fff84d1 commit 852f44a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions consensus/polybft/polybft.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ func (p *Polybft) startConsensusProtocol() {
return
}

p.logger.Debug("peers connected")

newBlockSub := p.blockchain.SubscribeEvents()
defer newBlockSub.Close()

Expand Down
10 changes: 5 additions & 5 deletions e2e-polybft/e2e/acls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestE2E_AllowList_ContractDeployment(t *testing.T) {

otherAddr := types.Address{0x1}

cluster := framework.NewTestCluster(t, 3,
cluster := framework.NewTestCluster(t, 5,
framework.WithPremine(adminAddr, targetAddr),
framework.WithContractDeployerAllowListAdmin(adminAddr),
framework.WithContractDeployerAllowListEnabled(otherAddr),
Expand Down Expand Up @@ -140,7 +140,7 @@ func TestE2E_BlockList_ContractDeployment(t *testing.T) {

otherAddr := types.Address{0x1}

cluster := framework.NewTestCluster(t, 3,
cluster := framework.NewTestCluster(t, 5,
framework.WithPremine(adminAddr, targetAddr),
framework.WithContractDeployerBlockListAdmin(adminAddr),
framework.WithContractDeployerBlockListEnabled(otherAddr),
Expand Down Expand Up @@ -223,7 +223,7 @@ func TestE2E_AllowList_Transactions(t *testing.T) {
targetAddr := types.Address(target.Address())
otherAddr := types.Address(other.Address())

cluster := framework.NewTestCluster(t, 3,
cluster := framework.NewTestCluster(t, 5,
framework.WithPremine(adminAddr, targetAddr, otherAddr),
framework.WithTransactionsAllowListAdmin(adminAddr),
framework.WithTransactionsAllowListEnabled(otherAddr),
Expand Down Expand Up @@ -306,7 +306,7 @@ func TestE2E_BlockList_Transactions(t *testing.T) {
targetAddr := types.Address(target.Address())
otherAddr := types.Address(other.Address())

cluster := framework.NewTestCluster(t, 3,
cluster := framework.NewTestCluster(t, 5,
framework.WithPremine(adminAddr, targetAddr, otherAddr),
framework.WithTransactionsBlockListAdmin(adminAddr),
framework.WithTransactionsBlockListEnabled(otherAddr),
Expand Down Expand Up @@ -376,7 +376,7 @@ func TestE2E_AddressLists_Bridge(t *testing.T) {
targetAddr := types.Address(target.Address())
otherAddr := types.Address(other.Address())

cluster := framework.NewTestCluster(t, 3,
cluster := framework.NewTestCluster(t, 5,
framework.WithPremine(adminAddr, targetAddr, otherAddr),
framework.WithBridgeAllowListAdmin(adminAddr),
framework.WithBridgeAllowListEnabled(otherAddr),
Expand Down
2 changes: 1 addition & 1 deletion e2e-polybft/framework/test-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ func (c *TestCluster) WaitUntil(timeout, pollFrequency time.Duration, handler fu
func (c *TestCluster) WaitForReady(t *testing.T) {
t.Helper()

require.NoError(t, c.WaitForBlock(1, 30*time.Second))
require.NoError(t, c.WaitForBlock(1, time.Minute))
}

func (c *TestCluster) WaitForBlock(n uint64, timeout time.Duration) error {
Expand Down
2 changes: 1 addition & 1 deletion e2e-polybft/property/property_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestProperty_DifferentVotingPower(t *testing.T) {

rapid.Check(t, func(tt *rapid.T) {
var (
numNodes = rapid.Uint64Range(4, 8).Draw(tt, "number of cluster nodes")
numNodes = rapid.Uint64Range(5, 8).Draw(tt, "number of cluster nodes")
epochSize = rapid.OneOf(rapid.Just(4), rapid.Just(10)).Draw(tt, "epoch size")
numBlocks = rapid.Uint64Range(2, 5).Draw(tt, "number of blocks the cluster should mine")
)
Expand Down
2 changes: 1 addition & 1 deletion network/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (s *Server) runDial() {
//nolint:godox
// TODO: Right now the dial task are done sequentially because Connect
// is a blocking request. In the future we should try to make up to
// maxDials requests concurrently (to be fixed in EVM-541)
// maxDials requests concurrently (to be fixed in EVM-543)
for s.connectionCounts.HasFreeOutboundConn() {
tt := s.dialQueue.PopTask()
if tt == nil {
Expand Down

0 comments on commit 852f44a

Please sign in to comment.