Unverified Commit 83ad99c4 authored by Preetha Appan's avatar Preetha Appan
Browse files

Some test fixes to e2e rescheduling tests

Showing with 11 additions and 7 deletions
+11 -7
......@@ -18,8 +18,9 @@ job "test" {
canary = 3
max_parallel = 1
min_healthy_time = "1s"
healthy_deadline = "1m"
auto_revert = true
healthy_deadline = "2s"
progress_deadline = "3s"
}
restart {
......
......@@ -16,8 +16,10 @@ job "test4" {
update {
max_parallel = 1
min_healthy_time = "10s"
min_healthy_time = "3s"
auto_revert = false
healthy_deadline = "5s"
progress_deadline = "10s"
}
restart {
......
......@@ -168,11 +168,11 @@ var _ = Describe("Server Side Restart Tests", func() {
ConsistOf([]string{"running", "running", "running"}))
})
Context("Updating job to make allocs fail", func() {
It("Should have no rescheduled allocs", func() {
It("Should have rescheduled allocs until progress deadline", func() {
job.TaskGroups[0].Tasks[0].Config["args"] = []string{"-c", "lol"}
_, _, err := jobs.Register(job, nil)
Expect(err).ShouldNot(HaveOccurred())
Eventually(allocStatusesRescheduled, 2*time.Second, time.Second).Should(BeEmpty())
Eventually(allocStatusesRescheduled, 5*time.Second, time.Second).ShouldNot(BeEmpty())
})
})
......@@ -192,16 +192,17 @@ var _ = Describe("Server Side Restart Tests", func() {
})
Context("Updating job to make allocs fail", func() {
It("Should have no rescheduled allocs", func() {
It("Should have rescheduled allocs until progress deadline", func() {
job.TaskGroups[0].Tasks[0].Config["args"] = []string{"-c", "lol"}
_, _, err := jobs.Register(job, nil)
Expect(err).ShouldNot(HaveOccurred())
Eventually(allocStatusesRescheduled, 2*time.Second, time.Second).Should(BeEmpty())
Eventually(allocStatusesRescheduled, 5*time.Second, time.Second).ShouldNot(BeEmpty())
// Verify new deployment and its status
// Deployment status should be running (because of progress deadline)
time.Sleep(3 * time.Second) //TODO(preetha) figure out why this wasn't working with ginkgo constructs
Eventually(deploymentStatus(), 2*time.Second, time.Second).Should(
ContainElement(structs.DeploymentStatusFailed))
ContainElement(structs.DeploymentStatusRunning))
})
})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment