Skip to content

Bind HBase mini cluster to loopback in tests - #321

Merged
em3s merged 1 commit into
mainfrom
fix/hbase-test-cluster-loopback-bind
May 12, 2026
Merged

em3s merged 1 commit into
mainfrom
fix/hbase-test-cluster-loopback-bind

Conversation

@em3s

@em3s em3s commented May 12, 2026

Copy link
Copy Markdown
Contributor

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), NettyRpcServer fails with Can't assign requested address before any test runs, so the whole HBaseAdminTest class reports an initializationError. Force the mini cluster to bind to loopback so it works regardless of the host's current network state.

Changes

  • HBaseTestingCluster.configureHBase sets hbase.{master,regionserver}.ipc.address to 127.0.0.1 and {master,regionserver}.hostname to localhost
  • Enable hbase.localcluster.assign.random.ports so concurrent test JVMs don't collide on leftover ports

How to Test

  • ./gradlew :engine:test --tests "*.HBaseAdminTest" — 7/7 pass on a machine where the previous fixture failed with BindException during mini cluster startup

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: Claude Code (Opus 4.7)

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]>
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. maintenance Maintenance work. labels May 12, 2026
@em3s
em3s merged commit 6faa717 into main May 12, 2026
3 checks passed
@em3s
em3s deleted the fix/hbase-test-cluster-loopback-bind branch May 12, 2026 13:12
@em3s em3s self-assigned this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Maintenance work. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant