Skip to content

Commit

Permalink
fix test so it hits a fake service (#9564)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9fcd5a5)
  • Loading branch information
helenosheaa authored and reimda committed Aug 18, 2021
1 parent 3cb135b commit 98f7510
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/inputs/phpfpm/phpfpm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,15 @@ func TestPhpFpmGeneratesMetrics_From_Socket_Custom_Status_Path(t *testing.T) {
//When not passing server config, we default to localhost
//We just want to make sure we did request stat from localhost
func TestPhpFpmDefaultGetFromLocalhost(t *testing.T) {
r := &phpfpm{}
r := &phpfpm{Urls: []string{"http://bad.localhost:62001/status"}}

require.NoError(t, r.Init())

var acc testutil.Accumulator

err := acc.GatherError(r.Gather)
require.Error(t, err)
assert.Contains(t, err.Error(), "127.0.0.1/status")
assert.Contains(t, err.Error(), "/status")
}

func TestPhpFpmGeneratesMetrics_Throw_Error_When_Fpm_Status_Is_Not_Responding(t *testing.T) {
Expand Down

0 comments on commit 98f7510

Please sign in to comment.