Some test fixes to e2e rescheduling tests

This commit is contained in:
Preetha Appan 2018-04-26 15:46:28 -05:00
parent e90d051c43
commit 02567ade71
No known key found for this signature in database
GPG key ID: 9F7C19990A50EAFC
3 changed files with 11 additions and 7 deletions

View file

@ -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 {

View file

@ -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 {

View file

@ -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))
})
})