Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed code to improve output for files under test/e2e/framework #105939

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/e2e/framework/providers/kubemark/kubemark.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func (p *Provider) FrameworkBeforeEach(f *framework.Framework) {
p.controller, err = kubemark.NewKubemarkController(externalClient, externalInformerFactory, f.ClientSet, kubemarkNodeInformer)
framework.ExpectNoError(err)
externalInformerFactory.Start(p.closeChannel)
framework.ExpectEqual(p.controller.WaitForCacheSync(p.closeChannel), true)
if !p.controller.WaitForCacheSync(p.closeChannel) {
framework.Failf("Unable to sync caches for %v", p.controller)
}
go p.controller.Run(p.closeChannel)
}
}
Expand Down
6 changes: 4 additions & 2 deletions test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ retriesLoop:
// NOTE the test may need access to the events to see what's going on, such as a change in status
actualWatchEvents := scenario(resourceWatch)
errs := sets.NewString()
ExpectEqual(len(expectedWatchEvents) <= len(actualWatchEvents), true, "Error: actual watch events amount (%d) must be greater than or equal to expected watch events amount (%d)", len(actualWatchEvents), len(expectedWatchEvents))
gomega.Expect(len(expectedWatchEvents)).To(gomega.BeNumerically("<=", len(actualWatchEvents)), "Did not get enough watch events")

totalValidWatchEvents := 0
foundEventIndexes := map[int]*int{}
Expand Down Expand Up @@ -1406,7 +1406,9 @@ retriesLoop:
fmt.Println("invariants violated:\n", strings.Join(errs.List(), "\n - "))
continue retriesLoop
}
ExpectEqual(errs.Len() > 0, false, strings.Join(errs.List(), "\n - "))
if errs.Len() > 0 {
Failf("Unexpected error(s): %v", strings.Join(errs.List(), "\n - "))
}
ExpectEqual(totalValidWatchEvents, len(expectedWatchEvents), "Error: there must be an equal amount of total valid watch events (%d) and expected watch events (%d)", totalValidWatchEvents, len(expectedWatchEvents))
break retriesLoop
}
Expand Down