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
007a70d8
Commit
007a70d8
authored
Oct 05, 2015
by
Marcin Wielgus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14984 from mwielgus/spark_fix
Wait for at least 1 endpoint in E2E test for examples
parents
acb9db6e
d5c40479
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
examples.go
test/e2e/examples.go
+15
-4
util.go
test/e2e/util.go
+15
-0
No files found.
test/e2e/examples.go
View file @
007a70d8
...
...
@@ -34,10 +34,9 @@ import (
)
const
(
podListTimeout
=
time
.
Minute
serverStartTimeout
=
podStartTimeout
+
3
*
time
.
Minute
dnsReadyTimeout
=
time
.
Minute
endpointRegisterTimeout
=
time
.
Minute
podListTimeout
=
time
.
Minute
serverStartTimeout
=
podStartTimeout
+
3
*
time
.
Minute
dnsReadyTimeout
=
time
.
Minute
)
const
queryDnsPythonTemplate
string
=
`
...
...
@@ -149,6 +148,8 @@ var _ = Describe("Examples e2e", func() {
_
,
err
:=
lookForStringInLog
(
ns
,
pod
.
Name
,
"rabbitmq"
,
"Server startup complete"
,
serverStartTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
waitForEndpoint
(
c
,
ns
,
"rabbitmq-service"
)
By
(
"starting celery"
)
runKubectl
(
"create"
,
"-f"
,
celeryControllerYaml
,
nsFlag
)
forEachPod
(
c
,
ns
,
"component"
,
"celery"
,
func
(
pod
api
.
Pod
)
{
...
...
@@ -192,6 +193,9 @@ var _ = Describe("Examples e2e", func() {
_
,
err
=
lookForStringInLog
(
ns
,
"spark-driver"
,
"spark-driver"
,
"Use kubectl exec"
,
serverStartTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
"waiting for master endpoint"
)
waitForEndpoint
(
c
,
ns
,
"spark-master"
)
By
(
"starting workers"
)
runKubectl
(
"create"
,
"-f"
,
workerControllerJson
,
nsFlag
)
ScaleRC
(
c
,
ns
,
"spark-worker-controller"
,
2
,
true
)
...
...
@@ -221,6 +225,8 @@ var _ = Describe("Examples e2e", func() {
_
,
err
=
lookForStringInLog
(
ns
,
"cassandra"
,
"cassandra"
,
"Listening for thrift clients"
,
serverStartTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
waitForEndpoint
(
c
,
ns
,
"cassandra"
)
By
(
"create and scale rc"
)
runKubectl
(
"create"
,
"-f"
,
controllerYaml
,
nsFlag
)
err
=
ScaleRC
(
c
,
ns
,
"cassandra"
,
2
,
true
)
...
...
@@ -263,12 +269,14 @@ var _ = Describe("Examples e2e", func() {
By
(
"checking if zookeeper is up and running"
)
_
,
err
=
lookForStringInLog
(
ns
,
zookeeperPod
,
"zookeeper"
,
"binding to port"
,
serverStartTimeout
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
waitForEndpoint
(
c
,
ns
,
"zookeeper"
)
By
(
"starting Nimbus"
)
runKubectl
(
"create"
,
"-f"
,
nimbusPodJson
,
nsFlag
)
runKubectl
(
"create"
,
"-f"
,
nimbusServiceJson
,
nsFlag
)
err
=
waitForPodRunningInNamespace
(
c
,
"nimbus"
,
ns
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
waitForEndpoint
(
c
,
ns
,
"nimbus"
)
By
(
"starting workers"
)
runKubectl
(
"create"
,
"-f"
,
workerControllerJson
,
nsFlag
)
...
...
@@ -382,6 +390,7 @@ var _ = Describe("Examples e2e", func() {
})
}
checkDbInstances
()
waitForEndpoint
(
c
,
ns
,
"rethinkdb-driver"
)
By
(
"scaling rethinkdb"
)
ScaleRC
(
c
,
ns
,
"rethinkdb-rc"
,
2
,
true
)
...
...
@@ -420,6 +429,8 @@ var _ = Describe("Examples e2e", func() {
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
waitForEndpoint
(
c
,
ns
,
"hazelcast"
)
By
(
"scaling hazelcast"
)
ScaleRC
(
c
,
ns
,
"hazelcast"
,
2
,
true
)
forEachPod
(
c
,
ns
,
"name"
,
"hazelcast"
,
func
(
pod
api
.
Pod
)
{
...
...
test/e2e/util.go
View file @
007a70d8
...
...
@@ -85,6 +85,7 @@ const (
podRespondingTimeout
=
2
*
time
.
Minute
serviceRespondingTimeout
=
2
*
time
.
Minute
endpointRegisterTimeout
=
time
.
Minute
// How wide to print pod names, by default. Useful for aligning printing to
// quickly scan through output.
...
...
@@ -740,6 +741,20 @@ func waitForReplicationController(c *client.Client, namespace, name string, exis
return
nil
}
func
waitForEndpoint
(
c
*
client
.
Client
,
ns
,
name
string
)
error
{
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
endpointRegisterTimeout
;
time
.
Sleep
(
poll
)
{
endpoint
,
err
:=
c
.
Endpoints
(
ns
)
.
Get
(
name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
if
len
(
endpoint
.
Subsets
)
==
0
||
len
(
endpoint
.
Subsets
[
0
]
.
Addresses
)
==
0
{
Logf
(
"Endpoint %s/%s is not ready yet"
,
ns
,
name
)
continue
}
else
{
return
nil
}
}
return
fmt
.
Errorf
(
"Failed to get entpoints for %s/%s"
,
ns
,
name
)
}
// Context for checking pods responses by issuing GETs to them and verifying if the answer with pod name.
type
podResponseChecker
struct
{
c
*
client
.
Client
...
...
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