@@ -361,6 +361,52 @@ var _ = Describe("AppWrapper E2E Test", func() {
361361Expect (err ).NotTo (HaveOccurred ())
362362})
363363
364+ It ("MCAD Scheduling Failure Preemption Test" , func () {
365+ fmt .Fprintf (os .Stdout , "[e2e] MCAD Bad Custom Pod Resources vs. Deployment Pod Resource Not Queuing Test - Started.\n " )
366+ context  :=  initTestContext ()
367+ var  appwrappers  []* arbv1.AppWrapper 
368+ appwrappersPtr  :=  & appwrappers 
369+ defer  cleanupTestObjectsPtr (context , appwrappersPtr )
370+ 
371+ // This should fill up the worker node and most of the master node 
372+ aw  :=  createDeploymentAWwith550CPU (context , "aw-deployment-2-550cpu" )
373+ appwrappers  =  append (appwrappers , aw )
374+ 
375+ err  :=  waitAWPodsReady (context , aw )
376+ Expect (err ).NotTo (HaveOccurred ())
377+ 
378+ // This should not fit on any node but should dispatch because there is enough aggregated resources. 
379+ aw2  :=  createGenericDeploymentCustomPodResourcesWithCPUAW (
380+ context , "aw-deployment-1-700-cpu" , "700m" , "700m" , 1 )
381+ 
382+ appwrappers  =  append (appwrappers , aw2 )
383+ 
384+ err  =  waitAWAnyPodsExists (context , aw2 )
385+ Expect (err ).NotTo (HaveOccurred ())
386+ 
387+ err  =  waitAWPodsPending (context , aw2 )
388+ Expect (err ).NotTo (HaveOccurred ())
389+ 
390+ // This should fit on cluster after AW aw-deployment-1-700-cpu above is automatically preempted on 
391+ // scheduling failure 
392+ aw3  :=  createGenericDeploymentCustomPodResourcesWithCPUAW (
393+ context , "aw-deployment-2-425-cpu" , "425m" , "425m" , 2 )
394+ 
395+ appwrappers  =  append (appwrappers , aw3 )
396+ 
397+ // Wait for pods to get created, assumes preemption around 1 minute 
398+ err  =  waitAWPodsExists (context , aw3 , 120000 * time .Millisecond )
399+ Expect (err ).NotTo (HaveOccurred ())
400+ 
401+ // Make sure they are running 
402+ err  =  waitAWPodsReady (context , aw3 )
403+ Expect (err ).NotTo (HaveOccurred ())
404+ 
405+ // Make sure pods from AW aw-deployment-1-700-cpu above do not exist proving preemption 
406+ err  =  waitAWAnyPodsExists (context , aw2 )
407+ Expect (err ).To (HaveOccurred ())
408+ 
409+ })
364410
365411It ("MCAD Bad Custom Pod Resources vs. Deployment Pod Resource Not Queuing Test" , func () {
366412fmt .Fprintf (os .Stdout , "[e2e] MCAD Bad Custom Pod Resources vs. Deployment Pod Resource Not Queuing Test - Started.\n " )
0 commit comments