Skip to content

Commit

Permalink
fix sporadic test failure in core_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit-0505 committed Oct 3, 2024
1 parent 3570ee8 commit 2c316ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/app/app_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

const (
pollingInterval = 50 * time.Millisecond
eventuallyTimeout = 3 * time.Second
eventuallyTimeout = 5 * time.Second
consistentlyDuration = 1 * time.Second
apiServiceTimeout = 5 * time.Minute
)
Expand Down
14 changes: 7 additions & 7 deletions internal/app/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ var _ = Describe("Core", func() {
}
Expect(k8sClient.Create(ctx, machine)).To(Succeed())

By("getting the resource quota")
By("waiting for the resource quota to be updated")
resourceQuotaKey := client.ObjectKeyFromObject(resourceQuota)
Expect(k8sClient.Get(ctx, resourceQuotaKey, resourceQuota)).To(Succeed())

By("inspecting the resource quota")
Expect(resourceQuota.Status.Used).To(Equal(corev1alpha1.ResourceList{
corev1alpha1.ResourceRequestsCPU: resource.MustParse("1"),
}))
Eventually(func(g Gomega) {
Expect(k8sClient.Get(ctx, resourceQuotaKey, resourceQuota)).To(Succeed())
g.Expect(resourceQuota.Status.Used).To(Equal(corev1alpha1.ResourceList{
corev1alpha1.ResourceRequestsCPU: resource.MustParse("1"),
}))
}).Should(Succeed())
})
})
})

0 comments on commit 2c316ba

Please sign in to comment.