diff --git a/tests/fixture/e2e/helpers.go b/tests/fixture/e2e/helpers.go index 0adffd60c7f..e473f3eebcb 100644 --- a/tests/fixture/e2e/helpers.go +++ b/tests/fixture/e2e/helpers.go @@ -121,8 +121,8 @@ func Eventually(condition func() bool, waitFor time.Duration, tick time.Duration func AddEphemeralNode(network *tmpnet.Network, flags tmpnet.FlagsMap) *tmpnet.Node { require := require.New(ginkgo.GinkgoT()) - node, err := network.AddEphemeralNode(DefaultContext(), ginkgo.GinkgoWriter, flags) - require.NoError(err) + node := tmpnet.NewEphemeralNode(flags) + require.NoError(network.StartNode(DefaultContext(), ginkgo.GinkgoWriter, node)) ginkgo.DeferCleanup(func() { tests.Outf("shutting down ephemeral node %q\n", node.NodeID) @@ -199,10 +199,10 @@ func CheckBootstrapIsPossible(network *tmpnet.Network) { ctx, cancel := context.WithTimeout(context.Background(), DefaultTimeout) defer cancel() - node, err := network.AddEphemeralNode(ctx, ginkgo.GinkgoWriter, tmpnet.FlagsMap{}) - // AddEphemeralNode will initiate node stop if an error is encountered during start, + node := tmpnet.NewEphemeralNode(tmpnet.FlagsMap{}) + require.NoError(network.StartNode(ctx, ginkgo.GinkgoWriter, node)) + // StartNode will initiate node stop if an error is encountered during start, // so no further cleanup effort is required if an error is seen here. - require.NoError(err) // Ensure the node is always stopped at the end of the check defer func() { diff --git a/tests/fixture/tmpnet/network.go b/tests/fixture/tmpnet/network.go index fdebb9d83e5..7a47e858b92 100644 --- a/tests/fixture/tmpnet/network.go +++ b/tests/fixture/tmpnet/network.go @@ -334,16 +334,6 @@ func (n *Network) Start(ctx context.Context, w io.Writer) error { return nil } -func (n *Network) AddEphemeralNode(ctx context.Context, w io.Writer, flags FlagsMap) (*Node, error) { - node := NewNode("") - node.Flags = flags - node.IsEphemeral = true - if err := n.StartNode(ctx, w, node); err != nil { - return nil, err - } - return node, nil -} - // Starts the provided node after configuring it for the network. func (n *Network) StartNode(ctx context.Context, w io.Writer, node *Node) error { if err := n.EnsureNodeConfig(node); err != nil { diff --git a/tests/fixture/tmpnet/node.go b/tests/fixture/tmpnet/node.go index 2d20ce09858..21ff4a05135 100644 --- a/tests/fixture/tmpnet/node.go +++ b/tests/fixture/tmpnet/node.go @@ -94,6 +94,15 @@ func NewNode(dataDir string) *Node { } } +// Initializes an ephemeral node using the provided config flags +func NewEphemeralNode(flags FlagsMap) *Node { + node := NewNode("") + node.Flags = flags + node.IsEphemeral = true + + return node +} + // Initializes the specified number of nodes. func NewNodes(count int) []*Node { nodes := make([]*Node, count)