@@ -61,6 +61,7 @@ var _ = Describe("AppWrapper Controller", func() {
6161 awConfig .FaultTolerance .FailureGracePeriod = 0 * time .Second
6262 awConfig .FaultTolerance .RetryPausePeriod = 0 * time .Second
6363 awConfig .FaultTolerance .RetryLimit = 0
64+ awConfig .FaultTolerance .SuccessTTL = 0 * time .Second
6465 awReconciler = & AppWrapperReconciler {
6566 Client : k8sClient ,
6667 Recorder : & record.FakeRecorder {},
@@ -172,7 +173,7 @@ var _ = Describe("AppWrapper Controller", func() {
172173 })
173174
174175 It ("Happy Path Lifecycle" , func () {
175- advanceToResuming (pod (100 ), pod (100 ))
176+ advanceToResuming (pod (100 , 1 ), pod (100 , 0 ))
176177 beginRunning ()
177178 fullyRunning ()
178179
@@ -211,14 +212,22 @@ var _ = Describe("AppWrapper Controller", func() {
211212 Expect ((* workload .AppWrapper )(aw ).IsSuspended ()).Should (BeFalse ())
212213 _ , _ , finished := (* workload .AppWrapper )(aw ).Finished ()
213214 Expect (finished ).Should (BeTrue ())
215+
216+ By ("Resources are Removed after TTL expires" )
217+ _ , err = awReconciler .Reconcile (ctx , reconcile.Request {NamespacedName : awName })
218+ Expect (err ).NotTo (HaveOccurred ())
219+ _ , err = awReconciler .Reconcile (ctx , reconcile.Request {NamespacedName : awName })
220+ Expect (err ).NotTo (HaveOccurred ())
221+ aw = getAppWrapper (awName )
222+ Expect (meta .IsStatusConditionTrue (aw .Status .Conditions , string (workloadv1beta2 .ResourcesDeployed ))).Should (BeFalse ())
214223 })
215224
216225 It ("Running Workloads can be Suspended" , func () {
217- advanceToResuming (pod (100 ), pod (100 ))
226+ advanceToResuming (pod (100 , 0 ), pod (100 , 1 ))
218227 beginRunning ()
219228 fullyRunning ()
220229
221- By ("Inoking Suspend and RestorePodSetsInfo" )
230+ By ("Invoking Suspend and RestorePodSetsInfo" )
222231 aw := getAppWrapper (awName )
223232 (* workload .AppWrapper )(aw ).Suspend ()
224233 Expect ((* workload .AppWrapper )(aw ).RestorePodSetsInfo (utilslices .Map (kueuePodSets , podset .FromPodSet ))).To (BeTrue ())
@@ -253,7 +262,7 @@ var _ = Describe("AppWrapper Controller", func() {
253262 })
254263
255264 It ("A Pod Failure leads to a failed AppWrapper" , func () {
256- advanceToResuming (pod (100 ), pod (100 ))
265+ advanceToResuming (pod (100 , 0 ), pod (100 , 0 ))
257266 beginRunning ()
258267 fullyRunning ()
259268
@@ -291,7 +300,7 @@ var _ = Describe("AppWrapper Controller", func() {
291300 })
292301
293302 It ("Failure during resource creation leads to a failed AppWrapper" , func () {
294- advanceToResuming (pod (100 ), malformedPod (100 ))
303+ advanceToResuming (pod (100 , 0 ), malformedPod (100 ))
295304
296305 By ("Reconciling: Resuming -> Failed" )
297306 _ , err := awReconciler .Reconcile (ctx , reconcile.Request {NamespacedName : awName })
0 commit comments