@@ -153,7 +153,7 @@ var _ = Describe("AppWrapper E2E Test", func() {
153153 // The job should be requeued 3 times before it finishes since the wait time is doubled each time the job is requeued (i.e., initially it waits
154154 // for 1 minutes before requeuing, then 2 minutes, and then 4 minutes). Since the init containers take 3 minutes
155155 // and 20 seconds to finish, a 4 minute wait should be long enough to finish the job successfully
156- aw := createJobAWWithInitContainer (context , "aw-job-3-init-container" , 60 , "exponential" , 0 )
156+ aw := createJobAWWithInitContainer (context , "aw-job-3-init-container-1 " , 60 , "exponential" , 0 )
157157 appwrappers = append (appwrappers , aw )
158158
159159 err := waitAWPodsCompleted (context , aw , 12 * time .Minute ) // This test waits for 12 minutes to make sure all PODs complete
@@ -556,10 +556,17 @@ var _ = Describe("AppWrapper E2E Test", func() {
556556 appwrappers = append (appwrappers , aw )
557557 err1 := waitAWPodsReady (context , aw )
558558 Expect (err1 ).NotTo (HaveOccurred (), "Expecting pods to be ready for app wrapper: aw-test-jobtimeout-with-comp-1" )
559- time .Sleep (90 * time .Second )
560- aw1 , err := context .karclient .McadV1beta1 ().AppWrappers (aw .Namespace ).Get (context .ctx , aw .Name , metav1.GetOptions {})
559+ var aw1 * arbv1.AppWrapper
560+ var err error
561+ aw1 , err = context .karclient .McadV1beta1 ().AppWrappers (aw .Namespace ).Get (context .ctx , aw .Name , metav1.GetOptions {})
561562 Expect (err ).NotTo (HaveOccurred (), "Expecting no error when getting app wrapper status" )
562563 fmt .Fprintf (GinkgoWriter , "[e2e] status of app wrapper: %v.\n " , aw1 .Status )
564+ for aw1 .Status .State != arbv1 .AppWrapperStateFailed {
565+ aw1 , err = context .karclient .McadV1beta1 ().AppWrappers (aw .Namespace ).Get (context .ctx , aw .Name , metav1.GetOptions {})
566+ if aw .Status .State == arbv1 .AppWrapperStateFailed {
567+ break
568+ }
569+ }
563570 Expect (aw1 .Status .State ).To (Equal (arbv1 .AppWrapperStateFailed ), "Expecting a failed state" )
564571 fmt .Fprintf (os .Stdout , "[e2e] MCAD app wrapper timeout Test - Completed.\n " )
565572 })
0 commit comments