manirajv06 commented on code in PR #911:
URL: https://github.com/apache/yunikorn-k8shim/pull/911#discussion_r1749963682


##########
test/e2e/gang_scheduling/gang_scheduling_test.go:
##########
@@ -725,7 +730,40 @@ func checkCompletedAppStatus(applicationID, state string) {
        Ω(timeoutErr).NotTo(HaveOccurred())
 }
 
-func checkPlaceholderData(appDaoInfo *dao.ApplicationDAOInfo, tgName string, 
count, replaced, timeout int) {
+func waitForPlaceholderData(nsQueue string, appID string, tgName string, 
count, replaced, timedOut, timeout int) error {
+       lastOk := false
+       var lastCount, lastReplaced, lastTimedOut int
+
+       err := wait.PollUntilContextTimeout(context.Background(), 
2*time.Second, time.Duration(timeout)*time.Second, false, func(c 
context.Context) (bool, error) {
+               appDaoInfo, err := 
restClient.GetAppInfo(configmanager.DefaultPartition, nsQueue, appID)
+               if err != nil {
+                       return false, err
+               }
+               lastOk, lastCount, lastReplaced, lastTimedOut = 
getPlaceholderData(appDaoInfo, tgName)
+               return lastOk && lastCount == count && lastReplaced == replaced 
&& lastTimedOut == timedOut, nil

Review Comment:
   To avoid the API call again to assert allocationsCount at caller side, Can 
we either assert or return allocationsCount?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to