narendly commented on a change in pull request #981:
URL: https://github.com/apache/helix/pull/981#discussion_r417562878
##########
File path:
helix-core/src/test/java/org/apache/helix/integration/task/TestTaskSchedulingTwoCurrentStates.java
##########
@@ -138,6 +139,18 @@ public void testTargetedTaskTwoCurrentStates() throws
Exception {
JobQueue.Builder jobQueue = TaskTestUtil.buildJobQueue(jobQueueName);
jobQueue.enqueueJob("JOB0", jobBuilder0);
+ // Make sure master has been correctly switched to Participant1
+ boolean isMasterSwitchedToCorrectInstance = TestHelper.verify(() -> {
+ ExternalView externalView =
_gSetupTool.getClusterManagementTool().getResourceExternalView(CLUSTER_NAME,
DATABASE);
+ Map <String, String> stateMap = externalView.getStateMap(DATABASE +
"_0");
+ String state = stateMap.getOrDefault(PARTICIPANT_PREFIX + "_" +
(_startPort + 1), null);
+ if (state == null) {
+ return false;
+ }
Review comment:
In this case, a simple containsKey check would do..
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]