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
f2adea25
Commit
f2adea25
authored
Jul 07, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10820 from wojtek-t/fix_proxy
Check whether all nodes are healthy in e2e framework
parents
d170ab08
9854d479
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
e2e.sh
hack/jenkins/e2e.sh
+2
-2
framework.go
test/e2e/framework.go
+5
-0
resize_nodes.go
test/e2e/resize_nodes.go
+4
-0
util.go
test/e2e/util.go
+16
-0
No files found.
hack/jenkins/e2e.sh
View file @
f2adea25
...
...
@@ -69,12 +69,12 @@ fi
GCE_DEFAULT_SKIP_TEST_REGEX
=
"Skipped|Density|Reboot|Restart|Example"
# The following tests are known to be flaky, and are thus run only in their own
# -flaky- build variants.
GCE_FLAKY_TEST_REGEX
=
"Elasticsearch|
Proxy.*logs|
Shell.*services|MaxPods.*"
GCE_FLAKY_TEST_REGEX
=
"Elasticsearch|Shell.*services|MaxPods.*"
# Tests which are not able to be run in parallel.
GCE_PARALLEL_SKIP_TEST_REGEX
=
"
${
GCE_DEFAULT_SKIP_TEST_REGEX
}
|Etcd|NetworkingNew|Nodes
\s
Network|Nodes
\s
Resize|MaxPods"
# Tests which are known to be flaky when run in parallel.
# TODO: figure out why GCE_FLAKY_TEST_REGEX is not a perfect subset of this list.
GCE_PARALLEL_FLAKY_TEST_REGEX
=
"Addon|Elasticsearch|Hostdir.*MOD|Networking.*intra|PD|
Proxy.*logs|
ServiceAccounts|Service
\s
endpoints
\s
latency|Services.*change
\s
the
\s
type|Services.*functioning
\s
external
\s
load
\s
balancer|Services.*identically
\s
named|Services.*release.*load
\s
balancer|Shell|multiport
\s
endpoints"
GCE_PARALLEL_FLAKY_TEST_REGEX
=
"Addon|Elasticsearch|Hostdir.*MOD|Networking.*intra|PD|ServiceAccounts|Service
\s
endpoints
\s
latency|Services.*change
\s
the
\s
type|Services.*functioning
\s
external
\s
load
\s
balancer|Services.*identically
\s
named|Services.*release.*load
\s
balancer|Shell|multiport
\s
endpoints"
# Define environment variables based on the Jenkins project name.
case
${
JOB_NAME
}
in
...
...
test/e2e/framework.go
View file @
f2adea25
...
...
@@ -85,6 +85,11 @@ func (f *Framework) afterEach() {
// you may or may not see the killing/deletion/cleanup events.
}
// Check whether all nodes are ready after the test.
if
err
:=
allNodesReady
(
f
.
Client
);
err
!=
nil
{
Failf
(
"All nodes should be ready after test, %v"
,
err
)
}
By
(
fmt
.
Sprintf
(
"Destroying namespace %q for this suite."
,
f
.
Namespace
.
Name
))
if
err
:=
f
.
Client
.
Namespaces
()
.
Delete
(
f
.
Namespace
.
Name
);
err
!=
nil
{
Failf
(
"Couldn't delete ns %q: %s"
,
f
.
Namespace
.
Name
,
err
)
...
...
test/e2e/resize_nodes.go
View file @
f2adea25
...
...
@@ -412,6 +412,10 @@ var _ = Describe("Nodes", func() {
})
AfterEach
(
func
()
{
By
(
"checking whether all nodes are healthy"
)
if
err
:=
allNodesReady
(
c
);
err
!=
nil
{
Failf
(
"Not all nodes are ready: %v"
,
err
)
}
By
(
fmt
.
Sprintf
(
"destroying namespace for this suite %s"
,
ns
))
if
err
:=
c
.
Namespaces
()
.
Delete
(
ns
);
err
!=
nil
{
Failf
(
"Couldn't delete namespace '%s', %v"
,
ns
,
err
)
...
...
test/e2e/util.go
View file @
f2adea25
...
...
@@ -1461,6 +1461,22 @@ func waitForNodeToBe(c *client.Client, name string, wantReady bool, timeout time
return
false
}
// checks whether all registered nodes are ready
func
allNodesReady
(
c
*
client
.
Client
)
error
{
nodes
,
err
:=
c
.
Nodes
()
.
List
(
labels
.
Everything
(),
fields
.
Everything
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
var
notReady
[]
api
.
Node
for
_
,
node
:=
range
nodes
.
Items
{
if
isNodeReadySetAsExpected
(
&
node
,
false
)
{
notReady
=
append
(
notReady
,
node
)
}
}
if
len
(
notReady
)
>
0
{
return
fmt
.
Errorf
(
"Not ready nodes: %v"
,
notReady
)
}
return
nil
}
// Filters nodes in NodeList in place, removing nodes that do not
// satisfy the given condition
// TODO: consider merging with pkg/client/cache.NodeLister
...
...
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