From b278cf88ef3dd37814773f287b91d89cd6d1969c Mon Sep 17 00:00:00 2001 From: "Da K. Ma" Date: Fri, 27 Jul 2018 20:27:04 +0800 Subject: [PATCH] Added e2e for multiple jobs. Signed-off-by: Da K. Ma --- test/e2e.go | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/e2e.go b/test/e2e.go index 94a79d5d3f..adf617e4c6 100644 --- a/test/e2e.go +++ b/test/e2e.go @@ -43,6 +43,26 @@ var _ = Describe("E2E Test", func() { Expect(err).NotTo(HaveOccurred()) }) + It("Multiple Schedule QueueJobs", func() { + context := initTestContext() + defer cleanupTestContext(context) + + rep := clusterSize(context, oneCPU) + + qj1 := createQueueJob(context, "qj-1", 2, rep, "busybox", oneCPU, nil) + qj2 := createQueueJob(context, "qj-2", 2, rep, "busybox", oneCPU, nil) + qj3 := createQueueJob(context, "qj-3", 2, rep, "busybox", oneCPU, nil) + + err := waitJobReady(context, qj1.Name) + Expect(err).NotTo(HaveOccurred()) + + err = waitJobReady(context, qj2.Name) + Expect(err).NotTo(HaveOccurred()) + + err = waitJobReady(context, qj3.Name) + Expect(err).NotTo(HaveOccurred()) + }) + It("Gang scheduling", func() { context := initTestContext() defer cleanupTestContext(context) @@ -82,6 +102,33 @@ var _ = Describe("E2E Test", func() { Expect(err).NotTo(HaveOccurred()) }) + It("Multiple Preemption", func() { + context := initTestContext() + defer cleanupTestContext(context) + + slot := oneCPU + rep := clusterSize(context, slot) + + qj1 := createQueueJob(context, "preemptee-qj", 1, rep, "nginx", slot, nil) + err := waitTasksReady(context, qj1.Name, int(rep)) + Expect(err).NotTo(HaveOccurred()) + + qj2 := createQueueJob(context, "preemptor-qj", 1, rep, "nginx", slot, nil) + Expect(err).NotTo(HaveOccurred()) + + qj3 := createQueueJob(context, "preemptor-qj2", 1, rep, "nginx", slot, nil) + Expect(err).NotTo(HaveOccurred()) + + err = waitTasksReady(context, qj1.Name, int(rep)/3) + Expect(err).NotTo(HaveOccurred()) + + err = waitTasksReady(context, qj2.Name, int(rep)/3) + Expect(err).NotTo(HaveOccurred()) + + err = waitTasksReady(context, qj3.Name, int(rep)/3) + Expect(err).NotTo(HaveOccurred()) + }) + It("TaskPriority", func() { Skip("Skip TaskPriority test because of dind setting.") context := initTestContext()