Skip to content

Commit

Permalink
Revert memory regex comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
gururajsh committed Feb 2, 2023
1 parent c15860b commit 2ef297a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions integration/helpers/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func ConfirmStagingLogs(session *Session) {
Eventually(session).Should(gbytes.Say(`(?i)Creating container|Successfully created container|Staging\.\.\.|Staging process started \.\.\.|Staging Complete|Exit status 0|Uploading droplet\.\.\.|Uploading complete`))
}

func WaitForAppMemoryToTakeEffect(appName string, processIndex int, instanceIndex int, shouldRestartFirst bool, expectedMemory string) {
func WaitForAppMemoryToTakeEffect(appName string, processIndex int, instanceIndex int, shouldRestartFirst bool) {
if shouldRestartFirst {
session := CF("restart", appName)
Eventually(session).Should(Exit(0))
Expand All @@ -356,7 +356,6 @@ func WaitForAppMemoryToTakeEffect(appName string, processIndex int, instanceInde
Eventually(session).Should(Exit(0))
appTable := ParseV3AppProcessTable(session.Out.Contents())
return appTable.Processes[processIndex].Instances[instanceIndex].Memory
// }).Should(MatchRegexp(fmt.Sprintf(`\d+(\.\d+)?[KMG]? of %s`, expectedMemory)))
}).Should(MatchRegexp(`\d+(\.\d+)?[KMG]? of \d+[KMG]`))
}

Expand Down
12 changes: 6 additions & 6 deletions integration/v7/isolated/scale_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var _ = Describe("scale command", func() {
helpers.WithProcfileApp(func(appDir string) {
Eventually(helpers.CustomCF(helpers.CFEnv{WorkingDirectory: appDir}, "push", appName)).Should(Exit(0))
})
helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "1G")
helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false)
})

When("scale option flags are not provided", func() {
Expand Down Expand Up @@ -162,7 +162,7 @@ var _ = Describe("scale command", func() {
Consistently(session).ShouldNot(Say("Stopping"))
Consistently(session).ShouldNot(Say("Starting"))

helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, true, "1G")
helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, true)

session = helpers.CF("app", appName)
Eventually(session).Should(Exit(0))
Expand Down Expand Up @@ -191,7 +191,7 @@ var _ = Describe("scale command", func() {
Expect(session).To(Say(`Stopping app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName))
Expect(session).To(Say(`Starting app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName))

helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "64M")
helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false)
})

When("-f flag provided", func() {
Expand All @@ -200,7 +200,7 @@ var _ = Describe("scale command", func() {
Eventually(session).Should(Exit(0))
Expect(session).To(Say("Scaling app %s in org %s / space %s as %s...", appName, orgName, spaceName, userName))

helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "64M")
helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false)
})
})
})
Expand Down Expand Up @@ -312,7 +312,7 @@ var _ = Describe("scale command", func() {
Expect(session).To(Say(`Stopping app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName))
Expect(session).To(Say(`Starting app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName))

helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "60M")
helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false)

//Delay to reduce flakiness
time.Sleep(5 * time.Second)
Expand Down Expand Up @@ -345,7 +345,7 @@ var _ = Describe("scale command", func() {
Expect(session).To(Say(`Stopping app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName))
Expect(session).To(Say(`Starting app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName))

helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false, "6M")
helpers.WaitForAppMemoryToTakeEffect(appName, 0, 0, false)

session = helpers.CF("restart", appName)
Eventually(session).Should(Exit(1))
Expand Down

0 comments on commit 2ef297a

Please sign in to comment.