Github user srdo commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2419#discussion_r151707538
  
    --- Diff: 
storm-server/src/test/java/org/apache/storm/scheduler/resource/strategies/scheduling/TestGenericResourceAwareStrategy.java
 ---
    @@ -187,16 +199,21 @@ public void testGenericResourceAwareStrategy() {
             rs.prepare(conf);
             rs.schedule(topologies, cluster);
     
    +        //We need to have 3 slots on 3 separate hosts to make the GPU 
situation work
    +
             HashSet<HashSet<ExecutorDetails>> expectedScheduling = new 
HashSet<>();
    -        expectedScheduling.add(new HashSet<>(Arrays.asList(new 
ExecutorDetails(0, 0)))); //Spout
    +        expectedScheduling.add(new HashSet<>(Arrays.asList(new 
ExecutorDetails(3, 3)))); //bolt-3 - 500 MB, 50% CPU, 2 GPU
    --- End diff --
    
    That makes sense. What I'm unsure about is what determines the task 
numbering, I'm not understanding why the numbering is spout - 0, bolt1 - 1, 2, 
bolt2 - 5, 6, bolt3 - 3, 4. I would have thought they'd be numbered in 
declaration order?
    
    `genExecsAndComps` enumerates the tasks by counting the parallelism hint 
for each bolt but it iterates the bolts via a map entryset. I think iteration 
order for those is undefined except for specific map types, and it looks like 
TopologyBuilder is using a HashMap. It might make this test unstable, or at 
least be inconsistent for different JVMs?


---

Reply via email to