Skip to content

Commit c7817f8

Browse files
committed
fix tests
1 parent c318bd8 commit c7817f8

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

operators/pkg/instautoctrl/test_e2e/instautoctrl_expiration_test.go

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ var _ = Describe("Instautoctrl-expiration", func() {
4646
CustomDeleteAfter2 = "0m"
4747
CustomInactivityTimeout2 = "2m"
4848

49-
timeout = time.Second * 65
50-
timeoutSmall = time.Second * 30
49+
timeout = time.Second * 70
50+
timeoutSmall = time.Second * 10
5151
interval = time.Millisecond * 1000
5252
)
5353

@@ -273,41 +273,24 @@ var _ = Describe("Instautoctrl-expiration", func() {
273273
})
274274

275275
Context("Testing maximum deletion time", func() {
276-
It("Should succeed: the persistent VM reached the maximum lifespan and it is deleted", func() {
276+
It("Should succeed: the VM reached the maximum lifespan and it is deleted", func() {
277277
By("Getting current instance")
278278
currentInstance := &crownlabsv1alpha2.Instance{}
279279
instanceLookupKey := types.NamespacedName{Name: NonPersistentInstanceName, Namespace: WorkingNamespace}
280280
Expect(k8sClientExpiration.Get(ctx, instanceLookupKey, currentInstance)).Should(Succeed())
281281

282282
By("waiting for the persistent VM to reach the maximum deletion time")
283-
doesEventuallyExists(ctx, instanceLookupKey, currentInstance, BeFalse(), timeout, interval, k8sClientExpiration)
283+
doesEventuallyExists(ctx, instanceLookupKey, currentInstance, BeFalse(), timeoutSmall, interval, k8sClientExpiration)
284284

285285
})
286-
287286
})
288287

289288
Context("Testing never deletion", func() {
290-
// It("Should succeed: the persistent VM is not deleted because it has a never deletion time", func() {
291-
// By("Getting current instance")
292-
// currentInstance := &crownlabsv1alpha2.Instance{}
293-
// instanceLookupKey := types.NamespacedName{Name: PersistentInstanceName, Namespace: WorkingNamespace}
294-
// Expect(k8sClientExpiration.Get(ctx, instanceLookupKey, currentInstance)).Should(Succeed())
295-
296-
// By("Checking that the persistent template has a never deletion time")
297-
// currentTemplate := &crownlabsv1alpha2.Template{}
298-
// templateLookupKey := types.NamespacedName{Name: persistentTemplateName, Namespace: WorkingNamespace}
299-
// Expect(k8sClientExpiration.Get(ctx, templateLookupKey, currentTemplate)).Should(Succeed())
300-
// Expect(currentTemplate.Spec.DeleteAfter).To(Equal(instautoctrl.NeverTimeoutValue))
301-
302-
// By("waiting for the persistent VM to not reach the maximum deletion time")
303-
// doesEventuallyExists(ctx, instanceLookupKey, currentInstance, BeTrue(), timeout, interval, k8sClientExpiration)
304-
305-
// })
306289

307290
It(("Should succeed: the non-persistent VM is not deleted because it has not reached yet the deletion time"), func() {
308291
By("Getting current instance")
309292
currentInstance := &crownlabsv1alpha2.Instance{}
310-
instanceLookupKey := types.NamespacedName{Name: NonPersistentInstanceName, Namespace: WorkingNamespace}
293+
instanceLookupKey := types.NamespacedName{Name: PersistentInstanceName, Namespace: WorkingNamespace}
311294
Expect(k8sClientExpiration.Get(ctx, instanceLookupKey, currentInstance)).Should(Succeed())
312295

313296
By("waiting for the non-persistent VM to not reach the maximum deletion time")

0 commit comments

Comments
 (0)