Skip to content

Clean up instance validation logic and test#1342

Merged
huizhilu merged 1 commit intoapache:masterfrom
zhangmeng916:validation
Sep 3, 2020
Merged

Clean up instance validation logic and test#1342
huizhilu merged 1 commit intoapache:masterfrom
zhangmeng916:validation

Conversation

@zhangmeng916
Copy link
Contributor

@zhangmeng916 zhangmeng916 commented Sep 3, 2020

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

Fixed #1341

Description

  • Here are some details about my PR, including screenshots of any UI changes:

The cluster config null check and instance validation check are tangled together right now. We would like to make them clear and return proper error message to users. Also there are two tests in helix-core and helix-rest with exactly name about instance validation. We want to distinguish them to avoid confusion.
This PR put cluster config null check into valid instance config check, together with persist intermediate state check. If either of them is false, the instance validation check will fail with a "false" return, instead of throwing an exception.
It also renamed one of the test in TestInstanceValidationUtil so that helix-core and helix-rest don't have duplicated test names.

Tests

  • The following is the result of the "mvn test" command on the appropriate module:

[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 1200, Failures: 0, Errors: 0, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:10 h
[INFO] Finished at: 2020-09-02T19:28:18-07:00

[INFO]
[ERROR] Failures:
[ERROR] TestClusterAccessor.testUpdateConfigFields:167 » IndexOutOfBounds Index: 0, Si...
[INFO]
[ERROR] Tests run: 166, Failures: 1, Errors: 0, Skipped: 25
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.981 s
[INFO] Finished at: 2020-09-02T20:01:32-07:00

The failed test is a known issue: #1336
Will be addressed later.

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)

Copy link
Contributor

@huizhilu huizhilu left a comment

Choose a reason for hiding this comment

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

LGTM

@zhangmeng916
Copy link
Contributor Author

This PR is ready to be merged, approved by @pkuwm
Final commit message:
Clean up instance validation logic and test.

@huizhilu huizhilu merged commit 76b30eb into apache:master Sep 3, 2020
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.

Clean up instance validation logic and test

2 participants