Skip to content

Commit

Permalink
fix broken rolling restage with max-in-flight test
Browse files Browse the repository at this point in the history
  • Loading branch information
jcvrabo committed Jan 2, 2025
1 parent 65e6e41 commit fbba917
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion integration/v7/isolated/restage_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ var _ = Describe("restage command", func() {
userName, _ := helpers.GetCredentials()
session := helpers.CustomCF(helpers.CFEnv{
EnvVars: map[string]string{"CF_STARTUP_TIMEOUT": "0.1"},
}, "restage", appName, "--strategy", "rolling", "--max-in-flight", "3")
}, "restage", appName, "--strategy", "rolling")
Consistently(session.Err).ShouldNot(Say(`This action will cause app downtime\.`))
Eventually(session).Should(Say(`Restaging app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName))
Eventually(session).Should(Say(`Creating deployment for app %s\.\.\.`, appName))
Expand All @@ -157,6 +157,22 @@ var _ = Describe("restage command", func() {
Eventually(session).Should(Exit(1))
})
})

When("strategy rolling is given with max-in-flight", func() {
It("fails and displays the deployment failure message", func() {
userName, _ := helpers.GetCredentials()
session := helpers.CustomCF(helpers.CFEnv{
EnvVars: map[string]string{"CF_STARTUP_TIMEOUT": "0.1"},
}, "restage", appName, "--strategy", "rolling", "--max-in-flight", "3")
Consistently(session.Err).ShouldNot(Say(`This action will cause app downtime\.`))
Eventually(session).Should(Say(`Restaging app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName))
Eventually(session).Should(Say(`Creating deployment for app %s\.\.\.`, appName))
Eventually(session).Should(Say(`Waiting for app to deploy\.\.\.`))
Eventually(session.Err).Should(Say(`Cannot cancel a deployment with status: FINALIZED and reason: DEPLOYED`))
Eventually(session).Should(Say("FAILED"))
Eventually(session).Should(Exit(1))
})
})
})

When("the app stages and starts properly", func() {
Expand Down

0 comments on commit fbba917

Please sign in to comment.