As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit f3df92bd authored by Igor Drozdov's avatar Igor Drozdov
Browse files

Merge branch '671-race-golang-1-x-failed-with-stdin-send-error-eof-2-1' into 'main'

Move global tempDir into StartSocketHttpServer()

Closes #671

See merge request https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/902



Merged-by: default avatarIgor Drozdov <idrozdov@gitlab.com>
Co-authored-by: default avatarAsh McKenzie <amckenzie@gitlab.com>
parents 74d3b483 c0bbf759
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -17,11 +17,6 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/testhelper"
)
var (
tempDir, _ = os.MkdirTemp("", "gitlab-shell-test-api")
testSocket = path.Join(tempDir, "internal.sock")
)
type TestRequestHandler struct {
Path string
Handler func(w http.ResponseWriter, r *http.Request)
Loading
Loading
@@ -30,9 +25,12 @@ type TestRequestHandler struct {
func StartSocketHttpServer(t *testing.T, handlers []TestRequestHandler) string {
t.Helper()
tempDir, _ := os.MkdirTemp("", "gitlab-shell-test-api")
t.Cleanup(func() { os.RemoveAll(tempDir) })
testSocket := path.Join(tempDir, "internal.sock")
err := os.MkdirAll(filepath.Dir(testSocket), 0700)
require.NoError(t, err)
t.Cleanup(func() { os.RemoveAll(tempDir) })
socketListener, err := net.Listen("unix", testSocket)
require.NoError(t, err)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment