daisyxchen commented on a change in pull request #3141: STORM-3518: Add support
to (un)favored nodes with range format
URL: https://github.com/apache/storm/pull/3141#discussion_r336659668
##########
File path:
storm-server/src/test/java/org/apache/storm/scheduler/resource/strategies/scheduling/TestDefaultResourceAwareStrategy.java
##########
@@ -628,7 +628,7 @@ public void testMultipleRacksWithFavoritism() {
t1Conf.putAll(config);
final List<String> t1FavoredHostNames = Arrays.asList("host-41",
"host-42", "host-43");
t1Conf.put(Config.TOPOLOGY_SCHEDULER_FAVORED_NODES,
t1FavoredHostNames);
- final List<String> t1UnfavoredHostIds = Arrays.asList("host-1",
"host-2", "host-3");
+ final List<String> t1UnfavoredHostIds = Arrays.asList("host-1",
"host-2", "host-3", "host[11-13]", "host[2-1]");
Review comment:
I ran the local test but it is weird that none of the host ids in topo1
favored list show up in the assigned cluster.
The original test code didn't test favored or unfavored hostIds at all.
```
for (WorkerSlot ws : assignment.getSlotToExecutors().keySet()) {
String hostName = rs.idToNode(ws.getNodeId()).getHostname();
String rackId = resolvedSuperVisors.get(hostName);
Assert.assertTrue(ws + " is neither on a favored node " +
t1FavoredHostNames + " nor the highest priority rack (rack-0)",
t1FavoredHostNames.contains(hostName) ||
"rack-0".equals(rackId));
Assert.assertFalse(ws + " is a part of an unfavored node " +
t1UnfavoredHostIds,
t1UnfavoredHostIds.contains(hostName));
}
```
The assigned hostIds are always host-001, host-000, host-002, host-003. Is
that expected in local unit test?
@revans2 , since you wrote the test code, do you have any insights about the
issue?
----------------------------------------------------------------
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]
With regards,
Apache Git Services