wilfred-s commented on a change in pull request #108: [YUNIKORN-47] Support 
node update action
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/108#discussion_r398325946
 
 

 ##########
 File path: pkg/scheduler/tests/scheduler_utils.go
 ##########
 @@ -103,6 +103,20 @@ func waitForNodesAllocatedResource(t *testing.T, cache 
*cache.ClusterInfo, parti
        }
 }
 
+func waitForNodesAvailableResource(t *testing.T, cache *cache.ClusterInfo, 
partitionName string, nodeIDs []string, availableMemory resources.Quantity, 
timeoutMs int) {
+       var totalNodeResource resources.Quantity
+       err := common.WaitFor(10*time.Millisecond, 
time.Duration(timeoutMs)*time.Millisecond, func() bool {
+               totalNodeResource = 0
+               for _, nodeID := range nodeIDs {
+                       totalNodeResource += 
cache.GetPartition(partitionName).GetNode(nodeID).GetAvailableResource().Resources[resources.MEMORY]
+               }
+               return totalNodeResource == availableMemory
+       })
+       if err != nil {
+               t.Fatalf("Failed to wait for available resource %v and node %v, 
called from: %s", availableMemory, nodeIDs, caller())
 
 Review comment:
   filed follow up jira: YUNIKORN-53

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: dev-h...@yunikorn.apache.org

Reply via email to