Skip to content

Commit

Permalink
Change the test to polling instead of just a single sleep
Browse files Browse the repository at this point in the history
- Avoid flakyness due to time it takes to bind a service

Signed-off-by: João Pereira <joaod@vmware.com>
  • Loading branch information
joaopapereira committed Aug 27, 2024
1 parent b580d96 commit 0e35f04
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions integration/v7/isolated/service_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,17 @@ var _ = Describe("service command", func() {
})

It("displays the bound apps", func() {
//Delay to reduce flakiness
time.Sleep(10 * time.Second)
session := helpers.CF(serviceCommand, serviceInstanceName, "-v")
Eventually(session).Should(Exit(0))

Expect(session).To(SatisfyAll(
Say(`Showing bound apps:\n`),
Say(`name\s+binding name\s+status\s+message\n`),
Say(`%s\s+%s\s+create succeeded\s*\n`, appName1, bindingName1),
Say(`%s\s+%s\s+create succeeded\s*\n`, appName2, bindingName2),
))
Eventually(func(g Gomega) {
session := helpers.CF(serviceCommand, serviceInstanceName, "-v").Wait()
g.Expect(session).Should(Exit(0))
output := session.Buffer().Contents()
g.Expect(output).Should(SatisfyAll(
Say(`Showing bound apps:\n`),
Say(`name\s+binding name\s+status\s+message\n`),
ContainSubstring(`%s\s+%s\s+create succeeded\s*\n`, appName1, bindingName1),
ContainSubstring(`%s\s+%s\s+create succeeded\s*\n`, appName2, bindingName2),
))
}).Should(Succeed())
})
})

Expand Down

0 comments on commit 0e35f04

Please sign in to comment.