Skip to content
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

[apache/helix] -- Fixed #2616, Simplified Test Code structure. #2617

Conversation

himanshukandwal
Copy link
Contributor

Issues

Description

  • Here are some details about my PR, including screenshots of any UI changes:
    In order to improve the code readability and maintenance, we have created following additional classes:
  • TestExecutionRuntime - contains the Cluster Runtime information.
  • TestClusterParameters - Parameters used to build the test ZK cluster.
  • TestExecutionFlow - Dynamics test flow writer, helps in abstracting the repeated test functions.
  • TestClusterOperations - Contains static functions to manipulate on the test cluster.
  • TestClusterValidateOperations - Contains static functions to run validations on the test cluster.

With this as just a beginging, there is a lot we can do here to find such as:

  • Find more of such patterns and enriching TestExecutionFlow to allow standardized & simpler test case writing.
  • With proper abstraction and encapsulation, we can create a pool of TestZKClusters and parallelize the test case executions (as right now we just create one ZK Server and all tests are run against it)

We have simplified ZKTestBase class and a simple test has been updated with using the TestExecutionFlow: org.apache.helix.integration.TestStandAloneCMSessionExpiry#testStandAloneCMSessionExpiry

Screenshot 2023-09-16 at 1 36 48 PM

Tests

  • The following tests are written for this issue:
  • TestStandAloneCMSessionExpiry#testStandAloneCMSessionExpiry
  • TestSchemataSM#testSchemataSM
  • The following is the result of the "mvn test" command on the appropriate module:

Changes that Break Backward Compatibility (Optional)

  • My PR contains changes that break backward compatibility or previous assumptions for certain methods or API. They include:

(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)

Documentation (Optional)

  • In case of new functionality, my PR adds documentation in the following wiki page:

(Link the GitHub wiki you added)

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

@@ -219,56 +219,9 @@ private static Method getMethod(String name) {
return null;
}

public static boolean verifyEmptyCurStateAndExtView(String clusterName, String resourceName,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to dedicated class: org/apache/helix/common/zkVerifiers/ExternalViewBalancedVerifier.java

@@ -30,7 +31,7 @@
import org.testng.Assert;
import org.testng.annotations.Test;

public class TestHelixConfigAccessor extends ZkUnitTestBase {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted ZkUnitTestBase class.

@junkaixue
Copy link
Contributor

This is too huge to review... Suggest you break it down into multiple PRs...

xyuanlu and others added 23 commits September 27, 2023 15:42
Final Commit Message:
Implement the on-demand rebalance service that performs rebalancing for offline or disabled instances without respecting the delay configuration.
---------

Co-authored-by: Xiaxuan Gao <[email protected]>
Instance Evacuation operation sanity check
Change instance operation orthogonal to instance enable
…o-join and auto-reg (apache#2609)

Add support for setting a default InstanceConfig through HelixManagerProperty. This will allow InstanceConfig fields be able to have defaults while also allowing users to leverage autoJoin and autoRegistration.
…ocessor during auto-reg (apache#2622)

Add support to persist all instance information collected by CloudInstanceInformationProcessor in CloudInstanceInformation object. Add ability for CloudInstanceInformationProcessor to produce full DOMAIN field instead of appending _instanceName unless last character in CloudInstanceInformation.CloudInstanceField.FAULT_DOMAIN is '='.
…GED. (apache#2621)

Exclude on-operation instance from computing min active replica in WAGED.
Final Commit Message:
Implement the on-demand rebalance service that performs rebalancing for offline or disabled instances without respecting the delay configuration.
---------

Co-authored-by: Xiaxuan Gao <[email protected]>
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.

5 participants