Repository navigation
Bind HBase mini cluster to loopback in tests - #321
Merged
Merged
Conversation
The mini cluster's default RPC bind derives from the host's hostname.
On laptops where hostname resolves to a stale interface (e.g. after a
network change), NettyRpcServer fails with "Can't assign requested
address" before any test runs, surfacing as an initializationError
for the whole HBaseAdminTest class.
Set hbase.{master,regionserver}.ipc.address to 127.0.0.1 and
{master,regionserver}.hostname to localhost so the mini cluster binds
to a guaranteed-local address regardless of the host's network state.
Enable hbase.localcluster.assign.random.ports to keep the cluster from
colliding with leftover ports across concurrent test JVMs.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The HBase test mini cluster derives its RPC bind address from the host's hostname. On laptops where the hostname resolves through mDNS to a stale interface (e.g. after a network change),
NettyRpcServerfails withCan't assign requested addressbefore any test runs, so the wholeHBaseAdminTestclass reports aninitializationError. Force the mini cluster to bind to loopback so it works regardless of the host's current network state.Changes
HBaseTestingCluster.configureHBasesetshbase.{master,regionserver}.ipc.addressto127.0.0.1and{master,regionserver}.hostnametolocalhosthbase.localcluster.assign.random.portsso concurrent test JVMs don't collide on leftover portsHow to Test
./gradlew :engine:test --tests "*.HBaseAdminTest"— 7/7 pass on a machine where the previous fixture failed withBindExceptionduring mini cluster startupAI Assistance