Skip to content

Commit

Permalink
fix test w/ merge
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Engelberg <[email protected]>
  • Loading branch information
jake-engelberg committed Sep 20, 2024
1 parent e4caf78 commit dc0f5d6
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/dapr/dapr/tests/integration/framework"

Check failure on line 29 in tests/integration/suite/daprd/resiliency/apps/defaultcircuitbreaker.go

View workflow job for this annotation

GitHub Actions / lint & proto validation (linux, amd64)

File is not `gofmt`-ed with `-s` (gofmt)
"github.com/dapr/dapr/tests/integration/framework/process/daprd"
prochttp "github.com/dapr/dapr/tests/integration/framework/process/http"
"github.com/dapr/dapr/tests/integration/framework/util"
"github.com/dapr/dapr/tests/integration/framework/client"
"github.com/dapr/dapr/tests/integration/suite"
)

Expand Down Expand Up @@ -113,7 +113,7 @@ func (d *defaultcircuitbreaker) Run(t *testing.T, ctx context.Context) {
for i := 1; i <= 3; i++ {
req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqURL, nil)
require.NoError(t, err)
resp, err := util.HTTPClient(t).Do(req)
resp, err := client.HTTP(t).Do(req)
require.NoError(t, err)
assert.Equal(t, http.StatusOK, resp.StatusCode)
require.NoError(t, resp.Body.Close())
Expand All @@ -122,7 +122,7 @@ func (d *defaultcircuitbreaker) Run(t *testing.T, ctx context.Context) {
// 4th call should not trigger circuit breaker
req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqURL, nil)
require.NoError(t, err)
resp, err := util.HTTPClient(t).Do(req)
resp, err := client.HTTP(t).Do(req)
require.NoError(t, err)
assert.Equal(t, http.StatusOK, resp.StatusCode)
require.NoError(t, err)
Expand All @@ -145,7 +145,7 @@ func (d *defaultcircuitbreaker) Run(t *testing.T, ctx context.Context) {
for i := 1; i <= 3; i++ {
req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqURL, nil)
require.NoError(t, err)
resp, err := util.HTTPClient(t).Do(req)
resp, err := client.HTTP(t).Do(req)
require.NoError(t, err)
assert.Equal(t, http.StatusInternalServerError, resp.StatusCode)
require.NoError(t, resp.Body.Close())
Expand All @@ -154,7 +154,7 @@ func (d *defaultcircuitbreaker) Run(t *testing.T, ctx context.Context) {
// 4th call should trigger circuit breaker, even though the server would have returned a 200
req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqURL, nil)
require.NoError(t, err)
resp, err := util.HTTPClient(t).Do(req)
resp, err := client.HTTP(t).Do(req)
require.NoError(t, err)
assert.Equal(t, http.StatusInternalServerError, resp.StatusCode)
require.NoError(t, err)
Expand All @@ -172,7 +172,7 @@ func (d *defaultcircuitbreaker) Run(t *testing.T, ctx context.Context) {
// This call should succeed and close the circuit
req, err = http.NewRequestWithContext(ctx, http.MethodGet, reqURL, nil)
require.NoError(t, err)
resp, err = util.HTTPClient(t).Do(req)
resp, err = client.HTTP(t).Do(req)
require.NoError(t, err)
assert.Equal(t, http.StatusOK, resp.StatusCode)
require.NoError(t, resp.Body.Close())
Expand All @@ -185,7 +185,7 @@ func (d *defaultcircuitbreaker) Run(t *testing.T, ctx context.Context) {
// Subsequent calls should succeed
req, err = http.NewRequestWithContext(ctx, http.MethodGet, reqURL, nil)
require.NoError(t, err)
resp, err = util.HTTPClient(t).Do(req)
resp, err = client.HTTP(t).Do(req)
require.NoError(t, err)
assert.Equal(t, http.StatusOK, resp.StatusCode)
require.NoError(t, resp.Body.Close())
Expand Down

0 comments on commit dc0f5d6

Please sign in to comment.