From 7c426f7ea4a2b8fcd5342612eb4e3c9a651d34dd Mon Sep 17 00:00:00 2001 From: Electronic-Waste <2690692950@qq.com> Date: Fri, 30 Aug 2024 14:51:29 +0000 Subject: [PATCH] test(trial): add wait interval. Signed-off-by: Electronic-Waste <2690692950@qq.com> --- pkg/controller.v1beta1/trial/trial_controller_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller.v1beta1/trial/trial_controller_test.go b/pkg/controller.v1beta1/trial/trial_controller_test.go index 97eed90b731..1084dffd657 100644 --- a/pkg/controller.v1beta1/trial/trial_controller_test.go +++ b/pkg/controller.v1beta1/trial/trial_controller_test.go @@ -52,6 +52,7 @@ const ( batchJobName = "test-job" objectiveMetric = "accuracy" timeout = time.Second * 80 + waitInterval = time.Second * 3 ) var trialKey = types.NamespacedName{Name: trialName, Namespace: namespace} @@ -314,6 +315,7 @@ func TestReconcileBatchJob(t *testing.T) { }, timeout).Should(gomega.BeTrue()) // Delete the Trial + time.Sleep(waitInterval) g.Expect(c.Delete(ctx, trial)).NotTo(gomega.HaveOccurred()) // Expect that Trial is deleted @@ -347,6 +349,7 @@ func TestReconcileBatchJob(t *testing.T) { }, timeout).Should(gomega.BeTrue()) // Delete the Trial + time.Sleep(waitInterval) g.Expect(c.Delete(ctx, trial)).NotTo(gomega.HaveOccurred()) // Expect that Trial is deleted @@ -385,6 +388,7 @@ func TestReconcileBatchJob(t *testing.T) { }, timeout).Should(gomega.BeTrue()) // Delete the Trial + time.Sleep(waitInterval) g.Expect(c.Delete(ctx, trial)).NotTo(gomega.HaveOccurred()) // Expect that Trial is deleted