You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Sigma-Ma (via GitHub)" <gi...@apache.org> on 2026/09/06 13:05:51 UTC
[PR] HBASE-29620 Refactor TestRSGroupsKillRS [hbase]
Sigma-Ma opened a new pull request, #8623:
URL: https://github.com/apache/hbase/pull/8623
## What changes were proposed in this pull request?
Split the mixed-version scenario into `TestRSGroupsKillRSWithDifferentVersions`. Use a test `HMaster` implementation to report a lower version for the target RegionServer, and restore `VersionInfo#getVersion` to return the generated version directly.
## Why are the changes needed?
The existing test changes process-wide `VersionInfo` state through reflection. Since MiniCluster components run in the same JVM, this may affect unrelated servers and requires production code to keep mutable state only for testing.
## How was this patch tested?
```bash
mvn -pl hbase-server -Dtest=TestRSGroupsKillRS,TestRSGroupsKillRSWithDifferentVersions -Dsurefire.failIfNoSpecifiedTests=false -Dsurefire.rerunFailingTestsCount=0 test
mvn -pl hbase-common -Dtest=TestVersionInfo -Dsurefire.rerunFailingTestsCount=0 test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-29620 Refactor TestRSGroupsKillRS [hbase]
Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on code in PR #8623:
URL: https://github.com/apache/hbase/pull/8623#discussion_r4028047794
##########
hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java:
##########
@@ -40,15 +40,12 @@ public class VersionInfo {
// higher than any numbers in the version.
private static final int VERY_LARGE_NUMBER = 100000;
- // Copying into a non-final member so that it can be changed by reflection for testing
- private static String version = Version.version;
-
/**
* Get the hbase version.
* @return the hbase version string, eg. "0.6.3-dev"
*/
public static String getVersion() {
- return version;
Review Comment:
This mutable field was introduced only to let the test override the version through reflection. Since the test now simulates the lower version through HMaster, the field is no longer needed, so getVersion() can return Version.version directly again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-29620 Refactor TestRSGroupsKillRS [hbase]
Posted by "Apache9 (via GitHub)" <gi...@apache.org>.
Apache9 commented on code in PR #8623:
URL: https://github.com/apache/hbase/pull/8623#discussion_r4032297851
##########
hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java:
##########
@@ -40,15 +40,12 @@ public class VersionInfo {
// higher than any numbers in the version.
private static final int VERY_LARGE_NUMBER = 100000;
- // Copying into a non-final member so that it can be changed by reflection for testing
- private static String version = Version.version;
-
/**
* Get the hbase version.
* @return the hbase version string, eg. "0.6.3-dev"
*/
public static String getVersion() {
- return version;
Review Comment:
This is the only place where we override this field by reflection?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-29620 Refactor TestRSGroupsKillRS [hbase]
Posted by "Apache9 (via GitHub)" <gi...@apache.org>.
Apache9 commented on code in PR #8623:
URL: https://github.com/apache/hbase/pull/8623#discussion_r4026497233
##########
hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java:
##########
@@ -40,15 +40,12 @@ public class VersionInfo {
// higher than any numbers in the version.
private static final int VERY_LARGE_NUMBER = 100000;
- // Copying into a non-final member so that it can be changed by reflection for testing
- private static String version = Version.version;
-
/**
* Get the hbase version.
* @return the hbase version string, eg. "0.6.3-dev"
*/
public static String getVersion() {
- return version;
Review Comment:
Why this change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] HBASE-29620 Refactor TestRSGroupsKillRS [hbase]
Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on code in PR #8623:
URL: https://github.com/apache/hbase/pull/8623#discussion_r4032673713
##########
hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java:
##########
@@ -40,15 +40,12 @@ public class VersionInfo {
// higher than any numbers in the version.
private static final int VERY_LARGE_NUMBER = 100000;
- // Copying into a non-final member so that it can be changed by reflection for testing
- private static String version = Version.version;
-
/**
* Get the hbase version.
* @return the hbase version string, eg. "0.6.3-dev"
*/
public static String getVersion() {
- return version;
Review Comment:
Yes. I checked the repository, and TestRSGroupsKillRS#setVersionInfoVersion is the only place that modifies VersionInfo.version through reflection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org