fix test so it hits a fake service (#9564)

This commit is contained in:
Helen Weller 2021-07-30 15:14:23 -04:00 committed by GitHub
parent ecafff3d4a
commit 9fcd5a5b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -274,7 +274,7 @@ func TestPhpFpmGeneratesMetrics_From_Socket_Custom_Status_Path(t *testing.T) {
//When not passing server config, we default to localhost //When not passing server config, we default to localhost
//We just want to make sure we did request stat from localhost //We just want to make sure we did request stat from localhost
func TestPhpFpmDefaultGetFromLocalhost(t *testing.T) { func TestPhpFpmDefaultGetFromLocalhost(t *testing.T) {
r := &phpfpm{} r := &phpfpm{Urls: []string{"http://bad.localhost:62001/status"}}
require.NoError(t, r.Init()) require.NoError(t, r.Init())
@ -282,7 +282,7 @@ func TestPhpFpmDefaultGetFromLocalhost(t *testing.T) {
err := acc.GatherError(r.Gather) err := acc.GatherError(r.Gather)
require.Error(t, err) 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) { func TestPhpFpmGeneratesMetrics_Throw_Error_When_Fpm_Status_Is_Not_Responding(t *testing.T) {