Skip to content

Fix test testMsgTriggeredRebalance#1117

Closed
huizhilu wants to merge 1 commit intoapache:masterfrom
huizhilu:fix-tests
Closed

Fix test testMsgTriggeredRebalance#1117
huizhilu wants to merge 1 commit intoapache:masterfrom
huizhilu:fix-tests

Conversation

@huizhilu
Copy link
Contributor

@huizhilu huizhilu commented Jun 23, 2020

Issues

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

Fixes #1116

Description

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

Unit test testMsgTriggeredRebalance() consistently fails, because we allow ignoring pending messages and sending ST messages when current state equals pending msg's to state. We should change the test condition a bit to allow messages number >= 1.

Two changes for the test:

  1. verify messages on each live instance are not purged. here
  2. This is the change to pass the test, allowing messages size >= 1. here

This PR also formats the file TestRebalancePipeline.java

Tests

  • The following tests are written for this issue:

Changed testMsgTriggeredRebalance

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

Only fix the test so just run and pass the single test.

END testMsgTriggeredRebalance at Tue Jun 23 01:54:12 PDT 2020, took: 7861ms.
Shut down zookeeper at port 2183 in thread main

===============================================
Default Suite
Total tests run: 1, Failures: 0, Skips: 0
===============================================

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"

Documentation (Optional)

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

(Link the GitHub wiki you added)

Code Quality

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

return true;
// Because current state equals pending message's toState, pending message is ignored
// and ST messages are sent to localhost_0, messages number >= 1
return !allMsgs.isEmpty() && allMsgs.get(0).getToState().equals("MASTER") && allMsgs.get(0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the change to pass the test, allowing messages size >= 1

return false;
}
// Should verify messages on each live instance are not purged.
isMessagePurged = isMessagePurged || messages.isEmpty();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change 1: verify messages on each live instance are not purged.

@huizhilu huizhilu closed this Jun 23, 2020
@huizhilu huizhilu deleted the fix-tests branch July 20, 2020 06:30
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.

Test testMsgTriggeredRebalance fails

1 participant