adityadtu5 commented on code in PR #1052:
URL: https://github.com/apache/yunikorn-k8shim/pull/1052#discussion_r3726343669


##########
pkg/cache/task_test.go:
##########
@@ -930,3 +934,94 @@ func TestCheckPodMetadataBeforeScheduling(t *testing.T) {
                })
        }
 }
+
+// newRollbackTask creates a task in Scheduling state with allocationKey and 
nodeName set,
+// ready to exercise rollbackOnAssumePodFailure.
+func newRollbackTask(ctx *Context, allocationKey, nodeID string) *Task {
+       app := NewApplication(appID1, queueNameA, testUser, testGroups, 
map[string]string{},
+               ctx.apiProvider.GetAPIs().SchedulerAPI)
+       pod := &v1.Pod{
+               TypeMeta:   metav1.TypeMeta{Kind: "Pod", APIVersion: "v1"},
+               ObjectMeta: metav1.ObjectMeta{Name: "rollback-pod", UID: 
"rollback-uid"},
+       }
+       task := NewTask(allocationKey, app, ctx, pod)
+       task.sm.SetState(TaskStates().Scheduling)
+       task.lock.Lock()
+       task.allocationKey = allocationKey
+       task.nodeName = nodeID
+       task.lock.Unlock()

Review Comment:
   thanks, done



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