|
| 1 | +// Copyright 2019 HAProxy Technologies LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +//go:build e2e_parallel |
| 16 | + |
| 17 | +package adminport |
| 18 | + |
| 19 | +import ( |
| 20 | + "net/http" |
| 21 | + |
| 22 | + "github.com/haproxytech/kubernetes-ingress/deploy/tests/e2e" |
| 23 | +) |
| 24 | + |
| 25 | +func (suite *AdminPortSuite) Test_Pprof() { |
| 26 | + suite.Run("OK", func() { |
| 27 | + suite.Eventually(func() bool { |
| 28 | + suite.client.Path = "/debug/pprof/cmdline" |
| 29 | + res, cls, err := suite.client.Do() |
| 30 | + if err != nil { |
| 31 | + suite.T().Logf("Connection ERROR: %s", err.Error()) |
| 32 | + return false |
| 33 | + } |
| 34 | + defer cls() |
| 35 | + return res.StatusCode == http.StatusOK |
| 36 | + }, e2e.WaitDuration, e2e.TickDuration) |
| 37 | + }) |
| 38 | + suite.Run("OK", func() { |
| 39 | + suite.Eventually(func() bool { |
| 40 | + suite.client.Path = "/debug/pprof/symbol" |
| 41 | + res, cls, err := suite.client.Do() |
| 42 | + if err != nil { |
| 43 | + suite.T().Logf("Connection ERROR: %s", err.Error()) |
| 44 | + return false |
| 45 | + } |
| 46 | + defer cls() |
| 47 | + return res.StatusCode == http.StatusOK |
| 48 | + }, e2e.WaitDuration, e2e.TickDuration) |
| 49 | + }) |
| 50 | +} |
0 commit comments