Skip to content

Commit

Permalink
e2e: cleanup node start function (#6842) (#6848)
Browse files Browse the repository at this point in the history
I realized after my last commit that my change made a following line of code a bit redundant.

(alternatively my last change was redunadnt to the existing code.)

I took this oppertunity to make some minor cleanups and logging changes to the node changes which I hope will make tests a bit more clear.

(cherry picked from commit a374f74)

Co-authored-by: Sam Kleinman <garen@tychoish.com>
(cherry picked from commit 4023580)
  • Loading branch information
mergify[bot] authored and iammadab committed Oct 13, 2021
1 parent 3a257c2 commit bffd7a9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/e2e/runner/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (
)

func Start(testnet *e2e.Testnet) error {
if len(testnet.Nodes) == 0 {
return fmt.Errorf("no nodes in testnet")
}

// Nodes are already sorted by name. Sort them by name then startAt,
// which gives the overall order startAt, mode, name.
Expand All @@ -29,9 +32,7 @@ func Start(testnet *e2e.Testnet) error {
sort.SliceStable(nodeQueue, func(i, j int) bool {
return nodeQueue[i].StartAt < nodeQueue[j].StartAt
})
if len(nodeQueue) == 0 {
return fmt.Errorf("no nodes in testnet")
}

if nodeQueue[0].StartAt > 0 {
return fmt.Errorf("no initial nodes in testnet")
}
Expand Down Expand Up @@ -93,10 +94,8 @@ func Start(testnet *e2e.Testnet) error {
}
}

logger.Info(fmt.Sprintf("Starting node %v at height %v...", node.Name, node.StartAt))
if _, _, err := waitForHeight(testnet, node.StartAt); err != nil {
return err
}
logger.Info("Starting catch up node", "node", node.Name, "height", node.StartAt)

if err := execCompose(testnet.Dir, "up", "-d", node.Name); err != nil {
return err
}
Expand Down

0 comments on commit bffd7a9

Please sign in to comment.