Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7b814a51
Commit
7b814a51
authored
Nov 23, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17640 from wojtek-t/fix_max_in_fligh_test
Auto commit by PR queue bot
parents
32c240b3
2766272f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
handlers_test.go
pkg/apiserver/handlers_test.go
+5
-6
No files found.
pkg/apiserver/handlers_test.go
View file @
7b814a51
...
...
@@ -61,8 +61,8 @@ func TestMaxInFlight(t *testing.T) {
const
Iterations
=
3
block
:=
sync
.
WaitGroup
{}
block
.
Add
(
1
)
oneFinished
:=
sync
.
WaitGroup
{}
oneFinished
.
Add
(
1
)
one
Accounted
Finished
:=
sync
.
WaitGroup
{}
one
Accounted
Finished
.
Add
(
1
)
var
once
sync
.
Once
sem
:=
make
(
chan
bool
,
Iterations
)
...
...
@@ -88,15 +88,14 @@ func TestMaxInFlight(t *testing.T) {
// These should hang waiting on block...
go
func
()
{
expectHTTP
(
server
.
URL
+
"/foo/bar/watch"
,
http
.
StatusOK
,
t
)
once
.
Do
(
oneFinished
.
Done
)
}()
}
// These should hang, but not affect accounting.
for
i
:=
0
;
i
<
Iterations
;
i
++
{
// These should hang waiting on block...
go
func
()
{
expectHTTP
(
server
.
URL
+
"/proxy/foo/bar"
,
http
.
StatusOK
,
t
)
once
.
Do
(
oneFinished
.
Done
)
}()
}
expectHTTP
(
server
.
URL
+
"/dontwait"
,
http
.
StatusOK
,
t
)
...
...
@@ -105,7 +104,7 @@ func TestMaxInFlight(t *testing.T) {
// These should hang waiting on block...
go
func
()
{
expectHTTP
(
server
.
URL
,
http
.
StatusOK
,
t
)
once
.
Do
(
oneFinished
.
Done
)
once
.
Do
(
one
Accounted
Finished
.
Done
)
}()
}
calls
.
Wait
()
...
...
@@ -123,7 +122,7 @@ func TestMaxInFlight(t *testing.T) {
// Show that we recover from being blocked up.
// However, we should until at least one of the requests really finishes.
oneFinished
.
Wait
()
one
Accounted
Finished
.
Wait
()
expectHTTP
(
server
.
URL
,
http
.
StatusOK
,
t
)
}
...
...
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