Skip to content
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

refactor: Simplify port forwarding and process management in kind tests #12393

Conversation

just-mitch
Copy link
Collaborator

@just-mitch just-mitch commented Mar 1, 2025

This change updates the port forwarding utility to dynamically allocate ports and improve process management across multiple end-to-end tests. Key modifications include:

  • Removing hardcoded host port configurations
  • Dynamically allocating ports during port forwarding
  • Centralizing process tracking with a forwardProcesses array
  • Adding afterAll hooks to kill port forward processes
  • Improving error handling and logging in port forward utility

The root cause was discovered by @spalladino. The time between a port being assigned in bash and then it being used was causing mismatches: two different services were trying to use the same port.

Also, not cleaning up ports behind ourselves was causing there to be an artificially low pool of ports to choose from.

…nd tests

This change updates the port forwarding utility to dynamically allocate ports and improve process management across multiple end-to-end tests. Key modifications include:

- Removing hardcoded host port configurations
- Dynamically allocating ports during port forwarding
- Centralizing process tracking with a `forwardProcesses` array
- Adding `afterAll` hooks to kill port forward processes
- Improving error handling and logging in port forward utility

The refactoring simplifies test setup and ensures proper cleanup of network resources across various Spartan test scenarios.
@just-mitch just-mitch linked an issue Mar 1, 2025 that may be closed by this pull request
@just-mitch just-mitch added the ci-full Run all master checks. label Mar 1, 2025
@just-mitch just-mitch changed the title refactor: Simplify port forwarding and process management in end-to-end tests refactor: Simplify port forwarding and process management in kind tests Mar 1, 2025
@just-mitch just-mitch enabled auto-merge (squash) March 1, 2025 01:42
@just-mitch just-mitch merged commit 9799392 into master Mar 3, 2025
12 of 14 checks passed
@just-mitch just-mitch deleted the 12367-bugflake-method-not-found-pxe_getnodeinfo-in-kind-ci-setup branch March 3, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-full Run all master checks.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(flake): Method not found pxe_getNodeInfo in kind CI setup
2 participants