Skip to content

HBASE-30086 Rewrite TestFromClientSide related tests#8098

Open
Apache9 wants to merge 3 commits intoapache:masterfrom
Apache9:HBASE-30086
Open

HBASE-30086 Rewrite TestFromClientSide related tests#8098
Apache9 wants to merge 3 commits intoapache:masterfrom
Apache9:HBASE-30086

Conversation

@Apache9
Copy link
Copy Markdown
Contributor

@Apache9 Apache9 commented Apr 17, 2026

No description provided.

@Apache9 Apache9 self-assigned this Apr 17, 2026
@Apache9
Copy link
Copy Markdown
Contributor Author

Apache9 commented Apr 17, 2026

As described on the jira issue, in this PR, we only change the ConnectionRegistry when creating Connection instance at client side, in this way, we do not need to restart the cluster when changing the ConnectionRegistry implementation any more. This is acceptable as the test is "TestFromClientSide".

In this PR, we

  1. Add RpcConnectionRegistry as parameter too, as it is the default registry implementation now.
  2. Refactor TestFromClientSide3 to also extends FromClientSideTestBase, to align it with other tests.
  3. TestFromClientSide is now TestFromClientSide1.
  4. Move testFilterAcrossMultipleRegions to a separate test class because it executes for a long time, which may cause TestFromClientSide1 time out.
  5. Remove testUnmanagedHConnection as it does not make sense in the current code base.
  6. Move testUnmanagedHConnectionReconnect to a separated test class because it needs special master setup and configurations.
  7. Move the test methods which do not need a cluster to a separated test class TestClientDataStructureMisc.
  8. Make TestTableScanMetrics not extends FromClientSideBase.

Copy link
Copy Markdown

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 rewrites and reorganizes the legacy TestFromClientSide test suite to use JUnit 5 and HBase’s @HBaseParameterizedTestTemplate, splitting large monolithic tests into reusable FromClientSideTest* bases and thin TestFromClientSide* wrappers (including coprocessor/no-unsafe variants).

Changes:

  • Migrates several client-side tests from JUnit 4 Parameterized/Categories to JUnit 5 (@Tag, @TestTemplate) with @HBaseParameterizedTestTemplate.
  • Refactors and re-homes large test bodies into new FromClientSideTest{1,3,4} base classes and adds new focused test classes (e.g., reconnect, filter-across-regions, client data structure misc).
  • Removes old “WithCoprocessor” JUnit 4 wrapper test classes and replaces them with JUnit 5 equivalents.

Reviewed changes

Copilot reviewed 29 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFromClientSide3WoUnsafe.java Converts to JUnit 5 parameterized template and starts cluster with endpoint CP.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/NoOpScanPolicyObserver.java Adjusts javadoc reference formatting after test renames/removals.
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java Fixes logger class reference after test restructuring.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableScanMetrics.java Migrates to JUnit 5 template-based parameterization for forward/reverse scans.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java Updates static import to new base (FromClientSideTest3).
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIncrementsFromClientSide.java Redirects shared assertion helper call to FromClientSideTestBase.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideWithCoprocessor5.java Deleted: legacy JUnit 4 wrapper test.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideWithCoprocessor4.java Deleted: legacy JUnit 4 wrapper test.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideWithCoprocessor.java Deleted: legacy JUnit 4 wrapper test.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideScanExcpetionWithCoprocessor.java Migrates to JUnit 5 and re-bases on new scan-exception test base.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideScanExcpetion.java Replaced implementation with JUnit 5 wrapper over new scan-exception base.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideNoCodec.java Migrates to JUnit 5 and replaces JUnit4 TestName with TableNameTestExtension.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideFilterAcrossMultipleRegionsWithCoprocessor.java New JUnit 5 wrapper running filter-across-regions tests with coprocessors enabled.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideFilterAcrossMultipleRegions.java New JUnit 5 wrapper running filter-across-regions tests without scan-policy observer.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide5WithCoprocessor.java New JUnit 5 wrapper for FromClientSideTest5 with endpoint CP.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4WithCoprocessor.java New JUnit 5 wrapper for FromClientSideTest4 with CPs.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide4.java Converted into thin JUnit 5 wrapper over FromClientSideTest4.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3WithCoprocessor.java New JUnit 5 wrapper for FromClientSideTest3 with CPs.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java Converted into thin JUnit 5 wrapper over FromClientSideTest3.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide1WithCoprocessor.java New JUnit 5 wrapper for FromClientSideTest1 with CPs.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide1.java New JUnit 5 wrapper for FromClientSideTest1 without scan-policy observer.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnectionReconnect.java New JUnit 5 parameterized reconnect test split out from old monolith.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientDataStructureMisc.java New small JUnit 5 test class extracted from old monolith.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideTestFilterAcrossMultipleRegions.java New shared base for filter-across-regions test logic.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideTestBase.java New shared JUnit 5 base for parameterized client-side suites (cluster + table naming + helpers).
hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideTest4.java New extracted FromClientSideTest4 implementation (large set of client tests).
hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideTest3.java Renames/rewrites FromClientSide3TestBase into FromClientSideTest3 using new base.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideTest1.java Renames/rewrites TestFromClientSide into FromClientSideTest1 using new base.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideScanExcpetionTestBase.java New extracted base containing the scan-exception injection tests.
Comments suppressed due to low confidence (1)

hbase-server/src/test/java/org/apache/hadoop/hbase/client/FromClientSideTestBase.java:85

  • Table name generation concatenates the test method name with the (parameterized) display name, which can become long enough to violate HBase table name length limits and cause failures when creating tables. Consider truncating to a safe max length and/or appending a short hash of the full display name to preserve uniqueness.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants