diff --git a/api/client.go b/api/client.go index 0699c1c204beced4368a7f9a1a1ce5e1ed62d8bf..de080ce1356e1ad423e48f65e4d17e9b17851086 100644 --- a/api/client.go +++ b/api/client.go @@ -157,7 +157,8 @@ func NewClient(host, token string, allowInsecure bool, isGraphQL bool, isOAuth2 if apiClient.httpClientOverride == nil { apiClient.httpClient = &http.Client{ Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, + DisableKeepAlives: true, + Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 5 * time.Second, KeepAlive: 5 * time.Second, diff --git a/cmd/glab/main_test.go b/cmd/glab/main_test.go index 7959a8977eccce5cdf6df00e56dcbd54a981c65d..c75329f58ca6b2137472f4576d56775f9daa1169 100644 --- a/cmd/glab/main_test.go +++ b/cmd/glab/main_test.go @@ -11,6 +11,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" "gitlab.com/gitlab-org/cli/commands/cmdutils" + "go.uber.org/goleak" ) func Test_printError(t *testing.T) { @@ -101,3 +102,7 @@ x lookup https://gitlab.com/api/v4: func TestGlab(t *testing.T) { main() } + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/commands/project/archive/repo_archive_integration_test.go b/commands/project/archive/repo_archive_integration_test.go index 4d518f6854ccd381a9ef5e2a006c1fceb8afa9aa..d537e2043514e3d23f13abf6c7b6a5e17acf87cc 100644 --- a/commands/project/archive/repo_archive_integration_test.go +++ b/commands/project/archive/repo_archive_integration_test.go @@ -79,6 +79,7 @@ func Test_repoArchive_Integration(t *testing.T) { if err != nil { t.Log(err) + t.Log(string(b)) if !tt.wantErr { t.Fatal(err) } diff --git a/go.mod b/go.mod index ce030efc5f653832a79e93483dd383d4ab8088b4..aa3e6671a4fd54fb8bcf76103c609710cd12c2d3 100644 --- a/go.mod +++ b/go.mod @@ -36,6 +36,8 @@ require ( github.com/tidwall/pretty v1.2.1 github.com/xanzy/go-gitlab v0.105.0 github.com/zalando/go-keyring v0.2.5 + go.uber.org/goleak v1.3.0 + golang.org/x/crypto v0.24.0 golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f golang.org/x/sync v0.7.0 golang.org/x/term v0.21.0 @@ -90,7 +92,6 @@ require ( github.com/yuin/goldmark-emoji v1.0.2 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.9.0 // indirect - golang.org/x/crypto v0.24.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.19.0 // indirect golang.org/x/sys v0.21.0 // indirect diff --git a/go.sum b/go.sum index 537050b473605039168c88a6c2c2816c9d361b17..3df20e441d0b20799c967d08d613d0635fd60e43 100644 --- a/go.sum +++ b/go.sum @@ -229,6 +229,8 @@ github.com/zalando/go-keyring v0.2.5 h1:Bc2HHpjALryKD62ppdEzaFG6VxL6Bc+5v0LYpN8L github.com/zalando/go-keyring v0.2.5/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=