Skip to content

[tmpnet] Move WaitForHealthy from a function to a tmpnet.Node method #3896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025

Conversation

maru-ava
Copy link
Contributor

@maru-ava maru-ava commented Apr 18, 2025

PR Chain: tmpnet+kube

This PR chain enables tmpnet to deploy temporary networks to Kubernetes. Early PRs refactor tmpnet to support the addition in #3615 of a new tmpnet node runtime for kube.

Why this should be merged

Nicer to be able to call node.WaitForHealthy(ctx) instead of tmpnet.WaitForHealthy(ctx, node).

How this was tested

CI

Need to be documented in RELEASES.md?

N/A

TODO

@maru-ava maru-ava added the tooling Build, test and development tooling label Apr 18, 2025
@maru-ava maru-ava requested a review from Copilot April 18, 2025 00:21
@maru-ava maru-ava self-assigned this Apr 18, 2025
@github-project-automation github-project-automation bot moved this to Backlog 🗄️ in avalanchego Apr 18, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the WaitForHealthy function by moving it from a global utility in tmpnet/utils.go to a method on the Node struct, allowing for cleaner, object-oriented calls.

  • Moved WaitForHealthy function from tmpnet/utils.go to Node struct in tmpnet/node.go
  • Updated call sites in network.go, e2e helpers, and duplicate node ID fault injection tests to use the new Node method

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/fixture/tmpnet/utils.go Removed the global WaitForHealthy function
tests/fixture/tmpnet/node.go Introduced Node.WaitForHealthy with improved error logging
tests/fixture/tmpnet/network.go Updated to call Node.WaitForHealthy instead of the removed util
tests/fixture/e2e/helpers.go Replaced call to global WaitForHealthy with Node.WaitForHealthy
tests/e2e/faultinjection/duplicate_node_id.go Updated WaitForHealthy call to use the Node method

@maru-ava maru-ava moved this from Backlog 🗄️ to In Review 👀 in avalanchego Apr 18, 2025
@maru-ava maru-ava changed the title [tmpnet] Move WaitForHealthy method to tmpnet.Node [tmpnet] Move WaitForHealthy from a function to a tmpnet.Node method Apr 18, 2025
@maru-ava maru-ava requested a review from felipemadero April 18, 2025 02:05
@maru-ava maru-ava force-pushed the tmpnet-ensure-context branch 2 times, most recently from a61bdec to 8511fd9 Compare April 18, 2025 20:45
Base automatically changed from tmpnet-ensure-context to master April 18, 2025 21:16
@maru-ava maru-ava force-pushed the tmpnet-move-waitforhealthy branch from 9c8d963 to ce11d86 Compare April 18, 2025 21:39
@maru-ava
Copy link
Contributor Author

Rebased

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Build, test and development tooling
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants