Skip to content

Commit

Permalink
test/e2e: add pprof
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Ostrowski <kostrows@redhat.com>
  • Loading branch information
ibihim committed Sep 20, 2022
1 parent dd0c134 commit 4269a94
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/e2e/useroauthaccesstokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import (
"context"
"crypto/sha256"
"encoding/base64"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"strconv"
"testing"
"time"
Expand All @@ -25,6 +29,29 @@ import (
userclient "github.com/openshift/client-go/user/clientset/versioned"
)

func TestMain(m *testing.M) {
go func() {
address := "127.0.0.1:8081"
fmt.Println("listen to: ", address)
if err := http.ListenAndServe(address, nil); err != nil {
fmt.Println(err)
}
}()

result := m.Run()

/*
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
fmt.Println("Waiting for SIGINT or SIGTERM")
<-sigs
*/

os.Exit(result)
}

func setupTokenStorage(t *testing.T, adminConfig *rest.Config, testNS string) (user1uid, user2uid, user1token, user2token string, trashBin *ResourceTrashbin, errors []error) {
testCtx := context.Background()
trashBin = NewResourceTrashbin(t, adminConfig)
Expand Down

0 comments on commit 4269a94

Please sign in to comment.