Skip to content

Commit

Permalink
Fix flaky 'odo list namespace' tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l committed Jan 4, 2024
1 parent 76bcd22 commit 47037ff
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/integration/cmd_namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ var _ = Describe("odo create/delete/list/set namespace/project tests", func() {
})

It("should list the new namespace when listing namespace", func() {
out := helper.Cmd("odo", "list", "namespace").ShouldPass().Out()
Expect(out).To(ContainSubstring(namespace))
Eventually(func() string {
return helper.Cmd("odo", "list", "namespace").ShouldPass().Out()
}, 60, 3).Should(ContainSubstring(namespace))
})
})

Expand All @@ -56,8 +57,10 @@ var _ = Describe("odo create/delete/list/set namespace/project tests", func() {
defer func(ns string) {
commonVar.CliRunner.DeleteNamespaceProject(ns, false)
}(namespace)
Expect(commonVar.CliRunner.HasNamespaceProject(namespace)).To(BeTrue())
Expect(commonVar.CliRunner.GetActiveNamespace()).To(Equal(namespace))
Eventually(func(g Gomega) {
g.Expect(commonVar.CliRunner.HasNamespaceProject(namespace)).To(BeTrue())
g.Expect(commonVar.CliRunner.GetActiveNamespace()).To(Equal(namespace))
}, 60, 3).Should(Succeed())
})

It(fmt.Sprintf("should fail to create %s", commandName), func() {
Expand Down

0 comments on commit 47037ff

Please sign in to comment.