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
853ea5ba
Commit
853ea5ba
authored
Jul 30, 2015
by
Mike Danese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11880 from mwielgus/rethinkdb-flaky
Add retry logic to http service request in test/e2e/examples.go
parents
bfaa5271
aa7d009b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
examples.go
test/e2e/examples.go
+22
-14
No files found.
test/e2e/examples.go
View file @
853ea5ba
...
...
@@ -34,9 +34,10 @@ import (
)
const
(
podListTimeout
=
time
.
Minute
serverStartTimeout
=
podStartTimeout
+
3
*
time
.
Minute
dnsReadyTimeout
=
time
.
Minute
podListTimeout
=
time
.
Minute
serverStartTimeout
=
podStartTimeout
+
3
*
time
.
Minute
dnsReadyTimeout
=
time
.
Minute
endpointRegisterTimeout
=
time
.
Minute
)
const
queryDnsPythonTemplate
string
=
`
...
...
@@ -161,7 +162,7 @@ var _ = Describe("Examples e2e", func() {
forEachPod
(
c
,
ns
,
"component"
,
"flower"
,
func
(
pod
api
.
Pod
)
{
// Do nothing. just wait for it to be up and running.
})
content
,
err
:=
makeHttpRequestToService
(
c
,
ns
,
"flower-service"
,
"/"
)
content
,
err
:=
makeHttpRequestToService
(
c
,
ns
,
"flower-service"
,
"/"
,
endpointRegisterTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
if
!
strings
.
Contains
(
content
,
"<title>Celery Flower</title>"
)
{
Failf
(
"Flower HTTP request failed"
)
...
...
@@ -392,7 +393,7 @@ var _ = Describe("Examples e2e", func() {
err
:=
waitForPodRunningInNamespace
(
c
,
"rethinkdb-admin"
,
ns
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
checkDbInstances
()
content
,
err
:=
makeHttpRequestToService
(
c
,
ns
,
"rethinkdb-admin"
,
"/"
)
content
,
err
:=
makeHttpRequestToService
(
c
,
ns
,
"rethinkdb-admin"
,
"/"
,
endpointRegisterTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
if
!
strings
.
Contains
(
content
,
"<title>RethinkDB Administration Console</title>"
)
{
Failf
(
"RethinkDB console is not running"
)
...
...
@@ -526,15 +527,22 @@ var _ = Describe("Examples e2e", func() {
})
})
func
makeHttpRequestToService
(
c
*
client
.
Client
,
ns
,
service
,
path
string
)
(
string
,
error
)
{
result
,
err
:=
c
.
Get
()
.
Prefix
(
"proxy"
)
.
Namespace
(
ns
)
.
Resource
(
"services"
)
.
Name
(
service
)
.
Suffix
(
path
)
.
Do
()
.
Raw
()
func
makeHttpRequestToService
(
c
*
client
.
Client
,
ns
,
service
,
path
string
,
timeout
time
.
Duration
)
(
string
,
error
)
{
var
result
[]
byte
var
err
error
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
timeout
;
time
.
Sleep
(
poll
)
{
result
,
err
=
c
.
Get
()
.
Prefix
(
"proxy"
)
.
Namespace
(
ns
)
.
Resource
(
"services"
)
.
Name
(
service
)
.
Suffix
(
path
)
.
Do
()
.
Raw
()
if
err
!=
nil
{
break
}
}
return
string
(
result
),
err
}
...
...
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