Skip to content

Commit

Permalink
Fix CurlEventuallyShouldOutput regression (#9571)
Browse files Browse the repository at this point in the history
* bugfix

* Update eventually-curl-succeeds-ignores-errors.yaml

* PR Feedback - use inner gomega

---------

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Jacob Bohanon <[email protected]>
  • Loading branch information
3 people committed Jun 4, 2024
1 parent 6c47bb6 commit 3435700
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
changelog:
- type: NON_USER_FACING
issueLink: https://github.com/solo-io/gloo/issues/9570
resolvesIssue: true
description: >-
Fix regression in `CurlEventuallyShouldOutput` that caused it to succeed on curl errors.
Regression has not been released, so no user facing documentation needed
12 changes: 3 additions & 9 deletions test/kube2e/helper/curl.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,15 @@ func (t *testContainer) CurlEventuallyShouldOutput(opts CurlOpts, expectedOutput

// for some useful-ish output
tick := time.Tick(currentTimeout / 8)
Expect(t.CanCurl()).To(BeTrue())

EventuallyWithOffset(ginkgoOffset+1, func(g Gomega) {
g.Expect(t.CanCurl()).To(BeTrue())

var res string

bufChan, done, err := t.CurlAsyncChan(opts)
if err != nil {
// trigger an early exit if the pod has been deleted
// if we return an error here, the Eventually will continue. By making an
// assertion with the outer context's Gomega, we can trigger a failure at
// that outer scope.
g.Expect(err).NotTo(MatchError(ContainSubstring(`pods "testserver" not found`)))
return
}
g.Expect(err).NotTo(HaveOccurred())

defer close(done)
var buf io.Reader
select {
Expand Down

0 comments on commit 3435700

Please sign in to comment.