Skip to content

Commit

Permalink
test: Fix ListAllowedOutboundServices test flake (openservicemesh#1611)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksubrmnn authored Aug 24, 2020
1 parent d293b86 commit b4e3fce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/catalog/routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ var _ = Describe("Catalog tests", func() {
actualList, err := mc.ListAllowedOutboundServices(tests.BookbuyerService)
Expect(err).ToNot(HaveOccurred())
expectedList := []service.MeshService{tests.BookstoreService, tests.BookstoreApexService}
Expect(actualList).To(Equal(expectedList))
Expect(len(actualList)).To(Equal(len(expectedList)))
Expect(actualList[0]).To(BeElementOf(expectedList))
Expect(actualList[1]).To(BeElementOf(expectedList))
})
})

Expand Down
1 change: 1 addition & 0 deletions pkg/endpoint/providers/kube/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ var _ = Describe("When getting a Service associated with a ServiceAccount", func
{Name: "test-1", Namespace: testNamespace},
{Name: "test-2", Namespace: testNamespace},
}
Expect(len(meshServices)).To(Equal(len(expectedServices)))
Expect(meshServices[0]).To(BeElementOf(expectedServices))
Expect(meshServices[1]).To(BeElementOf(expectedServices))

Expand Down
1 change: 1 addition & 0 deletions pkg/smi/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ var _ = Describe("When listing Services", func() {
Expect(len(services)).To(Equal(2))

expectedServices := []string{"test-1", "test-2"}
Expect(len(services)).To(Equal(len(expectedServices)))
Expect(services[0].Name).To(BeElementOf(expectedServices))
Expect(services[1].Name).To(BeElementOf(expectedServices))

Expand Down

0 comments on commit b4e3fce

Please sign in to comment.