diff --git a/command/v7/shared/app_stager.go b/command/v7/shared/app_stager.go index 2f5e73ad4e0..b5d231e2be3 100644 --- a/command/v7/shared/app_stager.go +++ b/command/v7/shared/app_stager.go @@ -171,6 +171,10 @@ func (stager *Stager) StartApp( if err != nil { return err } + if noWait == true { + stager.UI.DisplayText("First instance restaged correctly, restaging remaining in the background") + return nil + } } else { user, err := stager.Config.CurrentUser() if err != nil { diff --git a/command/v7/shared/app_stager_test.go b/command/v7/shared/app_stager_test.go index 079c4736616..b2c094cb3fa 100644 --- a/command/v7/shared/app_stager_test.go +++ b/command/v7/shared/app_stager_test.go @@ -125,6 +125,7 @@ var _ = Describe("app stager", func() { Expect(err).NotTo(HaveOccurred()) Expect(testUI.Out).To(Say(`Restarting app %s in org %s / space %s as %s\.\.\.`, app.Name, organization.Name, space.Name, user.Name)) Expect(testUI.Out).To(Say("Waiting for app to start...")) + }) When("staging fails", func() { @@ -170,6 +171,32 @@ var _ = Describe("app stager", func() { Expect(executeErr).To(MatchError("start-app-error")) }) }) + + When("The deployment strategy is rolling with nowait", func() { + BeforeEach(func() { + strategy = constant.DeploymentStrategyRolling + noWait = true + appStager = shared.NewAppStager(fakeActor, testUI, fakeConfig, fakeLogCacheClient) + executeErr = appStager.StageAndStart( + app, + space, + organization, + pkgGUID, + strategy, + noWait, + appAction, + ) + }) + + It("Restages and starts the app", func() { + Expect(executeErr).NotTo(HaveOccurred()) + + Expect(testUI.Out).To(Say("Creating deployment for app %s...", app.Name)) + Expect(testUI.Out).To(Say("Waiting for app to deploy...")) + + Expect(testUI.Out).To(Say("First instance restaged correctly, restaging remaining in the background")) + }) + }) }) Context("StageApp", func() { @@ -609,4 +636,5 @@ var _ = Describe("app stager", func() { Expect(executeErr).To(Not(HaveOccurred())) }) }) + })