Skip to content

Cleanup socket allocation logic in cluster info (and in tests in general) #5832

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alexpyattaev
Copy link

@alexpyattaev alexpyattaev commented Apr 15, 2025

Problem

#5824

  • Socket binding logic is a disaster of code duplication (mostly related to codestle and a hack to store RPC ports) with sudden flakiness mixed in (since multiple tests can be trying to book the same port ranges at the same time).
  • Tests would flake because we were relying on port binding logic to never try to reuse the same port twice (we'd look up a free port and still expect it to be free 5 seconds later all the while running 64 tests in parallel)

Summary of Changes

  • Merge the socket binding code into more coherent units, move some of the logic into net-utils for clarity (-200 LOC of boilerplate)
  • Add function to net-utils that can allocate 20-port slices that are unique across all tests currently running
  • Make all validator instances in unittests use non-intersecting port blocks using nextest environment variables to dedup them.

@alexpyattaev alexpyattaev force-pushed the cleanup_cluster_info branch from e8ce52e to a34fa4a Compare April 15, 2025 18:43
@alexpyattaev alexpyattaev marked this pull request as ready for review April 15, 2025 18:45
@alexpyattaev alexpyattaev requested a review from gregcusack April 15, 2025 19:26
@alexpyattaev alexpyattaev force-pushed the cleanup_cluster_info branch 2 times, most recently from 957f9a4 to 7e8b292 Compare April 15, 2025 21:54
@alexpyattaev alexpyattaev changed the title Cleanup cluster info Cleanup socket allocation logic in cluster info (and in tests in general) Apr 16, 2025
@alexpyattaev alexpyattaev force-pushed the cleanup_cluster_info branch from 0b78585 to b34f81c Compare April 16, 2025 10:35
@alexpyattaev alexpyattaev marked this pull request as draft April 17, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant