Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-workhorse
Commits
bbddde9f
Commit
bbddde9f
authored
Aug 01, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove path without process cleanup
parent
1a4272eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
main_test.go
main_test.go
+9
-8
No files found.
main_test.go
View file @
bbddde9f
...
...
@@ -24,7 +24,11 @@ func TestAllowedClone(t *testing.T) {
fmt
.
Fprintln
(
w
,
`{"GL_ID":"user-123"}`
)
}))
defer
ts
.
Close
()
defer
cleanUpProcessGroup
(
startServer
(
t
,
ts
))
cmd
,
err
:=
startServer
(
ts
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
defer
cleanUpProcessGroup
(
cmd
)
if
err
:=
os
.
RemoveAll
(
scratchDir
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
@@ -35,13 +39,13 @@ func TestAllowedClone(t *testing.T) {
}
}
func
startServer
(
t
*
testing
.
T
,
ts
*
httptest
.
Server
)
(
cmd
*
exec
.
Cmd
)
{
func
startServer
(
t
s
*
httptest
.
Server
)
(
cmd
*
exec
.
Cmd
,
err
error
)
{
var
conn
net
.
Conn
var
err
error
cmd
=
exec
.
Command
(
"go"
,
"run"
,
"main.go"
,
fmt
.
Sprintf
(
"-authBackend=%s"
,
ts
.
URL
),
fmt
.
Sprintf
(
"-listenAddr=%s"
,
servAddr
),
testRepoRoot
)
cmd
.
SysProcAttr
=
&
syscall
.
SysProcAttr
{
Setpgid
:
true
}
if
err
:=
cmd
.
Start
();
err
!=
nil
{
t
.
Fatal
(
err
)
err
=
cmd
.
Start
()
if
err
!=
nil
{
return
}
for
i
:=
0
;
i
<
servWaitListen
/
servWaitSleep
;
i
++
{
conn
,
err
=
net
.
Dial
(
"tcp"
,
servAddr
)
...
...
@@ -51,8 +55,5 @@ func startServer(t *testing.T, ts *httptest.Server) (cmd *exec.Cmd) {
}
time
.
Sleep
(
servWaitSleep
*
time
.
Millisecond
)
}
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
return
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment