Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
cam-schultz committed Nov 21, 2024
1 parent 997097c commit 47ee410
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions tests/flows/teleporter/validator_churn.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import (
. "github.com/onsi/gomega"
)

const newNodeCount = 2
const (
newNodeCount = 2
sleepPeriodSeconds = 5
)

func ValidatorChurn(network *localnetwork.LocalNetwork, teleporter utils.TeleporterTestInfo) {
subnetAInfo, subnetBInfo := network.GetTwoSubnets()
Expand Down Expand Up @@ -73,7 +76,7 @@ func ValidatorChurn(network *localnetwork.LocalNetwork, teleporter utils.Telepor
//

// Add new nodes to the validator set
addValidatorsCtx, cancel := context.WithTimeout(ctx, 90*newNodeCount*time.Second)
addValidatorsCtx, cancel := context.WithTimeout(ctx, (90+sleepPeriodSeconds)*newNodeCount*time.Second)
defer cancel()
newNodes := network.GetExtraNodes(newNodeCount)
validatorManagerAddress := network.GetValidatorManager(subnetAInfo.SubnetID)
Expand Down Expand Up @@ -107,7 +110,7 @@ func ValidatorChurn(network *localnetwork.LocalNetwork, teleporter utils.Telepor
network.GetNetworkID(),
)
// Sleep to ensure the validator manager uses a new churn tracking period
time.Sleep(5 * time.Second)
time.Sleep(sleepPeriodSeconds * time.Second)
}

// Refresh the subnet info
Expand Down
1 change: 0 additions & 1 deletion tests/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ func (n *LocalNetwork) Dir() string {
func (n *LocalNetwork) GetPChainWallet() pwallet.Wallet {
// Create the P-Chain wallet to issue transactions
kc := secp256k1fx.NewKeychain(n.globalFundedKey)
n.GetSubnetsInfo()
var subnetIDs []ids.ID
for _, subnet := range n.GetSubnetsInfo() {
subnetIDs = append(subnetIDs, subnet.SubnetID)
Expand Down

0 comments on commit 47ee410

Please sign in to comment.