From c8589614a6c8fd0b5808ddd802cf5d6578367860 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 21 Jun 2024 11:14:37 +0200 Subject: [PATCH] test: make nodes also restart after upgrading in knuu (#3556) Closes: https://github.com/celestiaorg/celestia-app/issues/3337 --- test/e2e/major_upgrade_v2.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index 374c632de9..92a794f755 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -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() @@ -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) @@ -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 }