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
4bbbb9a3
Commit
4bbbb9a3
authored
Dec 22, 2015
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e2e: Loop more to defeat service randomization
parent
13a853f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
service.go
test/e2e/service.go
+4
-4
No files found.
test/e2e/service.go
View file @
4bbbb9a3
...
@@ -1335,9 +1335,11 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod
...
@@ -1335,9 +1335,11 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod
defer
func
()
{
defer
func
()
{
deletePodOrFail
(
c
,
ns
,
execPodName
)
deletePodOrFail
(
c
,
ns
,
execPodName
)
}()
}()
// Loop a bunch of times - the proxy is randomized, so we want a good
// chance of hitting each backend at least once.
command
:=
fmt
.
Sprintf
(
command
:=
fmt
.
Sprintf
(
"for i in $(seq 1 %d); do wget -q -T 1 -O - http://%s:%d || true; echo; done"
,
"for i in $(seq 1 %d); do wget -q -T 1 -O - http://%s:%d || true; echo; done"
,
3
*
len
(
expectedPods
),
serviceIP
,
servicePort
)
50
*
len
(
expectedPods
),
serviceIP
,
servicePort
)
commands
:=
[]
func
()
string
{
commands
:=
[]
func
()
string
{
// verify service from node
// verify service from node
...
@@ -1367,9 +1369,7 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod
...
@@ -1367,9 +1369,7 @@ func verifyServeHostnameServiceUp(c *client.Client, ns, host string, expectedPod
for
_
,
cmdFunc
:=
range
commands
{
for
_
,
cmdFunc
:=
range
commands
{
passed
:=
false
passed
:=
false
pods
:=
[]
string
{}
pods
:=
[]
string
{}
// Retry cmdFunc for upto 5 minutes.
// Retry cmdFunc for a while
// TODO: make this stricter. Ideally hitting a Service with n pods n
// times should round robing to each pod, and one pass should suffice.
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
time
.
Minute
;
time
.
Sleep
(
5
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
time
.
Minute
;
time
.
Sleep
(
5
*
time
.
Second
)
{
pods
=
strings
.
Split
(
strings
.
TrimSpace
(
cmdFunc
()),
"
\n
"
)
pods
=
strings
.
Split
(
strings
.
TrimSpace
(
cmdFunc
()),
"
\n
"
)
// Uniq pods before the sort because inserting them into a set
// Uniq pods before the sort because inserting them into a set
...
...
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