Skip to content

Commit

Permalink
test: make nodes also restart after upgrading in knuu (#3556)
Browse files Browse the repository at this point in the history
Closes: #3337
  • Loading branch information
cmwaters authored Jun 21, 2024
1 parent 1c7590b commit c858961
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/e2e/major_upgrade_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func MajorUpgradeToV2(logger *log.Logger) error {
logger.Println("Running major upgrade to v2 test", "version", latestVersion)

numNodes := 4
upgradeHeight := int64(12)
upgradeHeight := int64(10)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down Expand Up @@ -60,6 +60,7 @@ func MajorUpgradeToV2(logger *log.Logger) error {

heightBefore := upgradeHeight - 1
for i := 0; i < numNodes; i++ {

client, err := testNet.Node(i).Client()
testnet.NoError("failed to get client", err)

Expand All @@ -79,7 +80,24 @@ func MajorUpgradeToV2(logger *log.Logger) error {
}
}

cancel()
// make all nodes in the network restart and ensure that progress is still made
for _, node := range testNet.Nodes() {
client, err := node.Client()
testnet.NoError("failed to get client", err)

height, err := getHeight(ctx, client, time.Minute)
if err != nil {
return fmt.Errorf("failed to get height: %w", err)
}

if err := node.Upgrade(latestVersion); err != nil {
return fmt.Errorf("failed to restart node: %w", err)
}

if err := waitForHeight(ctx, client, height+3, time.Minute); err != nil {
return fmt.Errorf("failed to wait for height: %w", err)
}
}

return nil
}
Expand Down

0 comments on commit c858961

Please sign in to comment.