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
e79f0469
Commit
e79f0469
authored
Jun 08, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #27041 from wojtek-t/unschedulable_nodes
Automatic merge from submit-queue Extend logging for UnschedulableNodes Ref #25845
parents
525a56ef
2777c8dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
scheduler_test.go
test/integration/scheduler_test.go
+17
-7
No files found.
test/integration/scheduler_test.go
View file @
e79f0469
...
...
@@ -103,13 +103,23 @@ func podScheduled(c *client.Client, podNamespace, podName string) wait.Condition
// Wait till the passFunc confirms that the object it expects to see is in the store.
// Used to observe reflected events.
func
waitForReflection
(
s
cache
.
Store
,
key
string
,
passFunc
func
(
n
interface
{})
bool
)
error
{
return
wait
.
Poll
(
time
.
Millisecond
*
10
,
time
.
Second
*
20
,
func
()
(
bool
,
error
)
{
func
waitForReflection
(
t
*
testing
.
T
,
s
cache
.
Store
,
key
string
,
passFunc
func
(
n
interface
{})
bool
)
error
{
nodes
:=
[]
*
api
.
Node
{}
err
:=
wait
.
Poll
(
time
.
Millisecond
*
100
,
wait
.
ForeverTestTimeout
,
func
()
(
bool
,
error
)
{
if
n
,
_
,
err
:=
s
.
GetByKey
(
key
);
err
==
nil
&&
passFunc
(
n
)
{
return
true
,
nil
}
else
{
nodes
=
append
(
nodes
,
n
.
(
*
api
.
Node
))
return
false
,
nil
}
return
false
,
nil
})
if
err
!=
nil
{
t
.
Logf
(
"Logging consecutive node versions received from store:"
)
for
i
,
n
:=
range
nodes
{
t
.
Logf
(
"%d: %#v"
,
i
,
n
)
}
}
return
err
}
func
DoTestUnschedulableNodes
(
t
*
testing
.
T
,
restClient
*
client
.
Client
,
nodeStore
cache
.
Store
)
{
...
...
@@ -159,7 +169,7 @@ func DoTestUnschedulableNodes(t *testing.T, restClient *client.Client, nodeStore
if
_
,
err
:=
c
.
Nodes
()
.
Update
(
n
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to update node with unschedulable=true: %v"
,
err
)
}
err
=
waitForReflection
(
s
,
nodeKey
,
func
(
node
interface
{})
bool
{
err
=
waitForReflection
(
t
,
s
,
nodeKey
,
func
(
node
interface
{})
bool
{
// An unschedulable node should get deleted from the store
return
node
==
nil
})
...
...
@@ -172,7 +182,7 @@ func DoTestUnschedulableNodes(t *testing.T, restClient *client.Client, nodeStore
if
_
,
err
:=
c
.
Nodes
()
.
Update
(
n
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to update node with unschedulable=false: %v"
,
err
)
}
err
=
waitForReflection
(
s
,
nodeKey
,
func
(
node
interface
{})
bool
{
err
=
waitForReflection
(
t
,
s
,
nodeKey
,
func
(
node
interface
{})
bool
{
return
node
!=
nil
&&
node
.
(
*
api
.
Node
)
.
Spec
.
Unschedulable
==
false
})
if
err
!=
nil
{
...
...
@@ -192,7 +202,7 @@ func DoTestUnschedulableNodes(t *testing.T, restClient *client.Client, nodeStore
if
_
,
err
=
c
.
Nodes
()
.
UpdateStatus
(
n
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to update node with bad status condition: %v"
,
err
)
}
err
=
waitForReflection
(
s
,
nodeKey
,
func
(
node
interface
{})
bool
{
err
=
waitForReflection
(
t
,
s
,
nodeKey
,
func
(
node
interface
{})
bool
{
return
node
!=
nil
&&
node
.
(
*
api
.
Node
)
.
Status
.
Conditions
[
0
]
.
Status
==
api
.
ConditionUnknown
})
if
err
!=
nil
{
...
...
@@ -209,7 +219,7 @@ func DoTestUnschedulableNodes(t *testing.T, restClient *client.Client, nodeStore
if
_
,
err
=
c
.
Nodes
()
.
UpdateStatus
(
n
);
err
!=
nil
{
t
.
Fatalf
(
"Failed to update node with healthy status condition: %v"
,
err
)
}
waitForReflection
(
s
,
nodeKey
,
func
(
node
interface
{})
bool
{
err
=
waitForReflection
(
t
,
s
,
nodeKey
,
func
(
node
interface
{})
bool
{
return
node
!=
nil
&&
node
.
(
*
api
.
Node
)
.
Status
.
Conditions
[
0
]
.
Status
==
api
.
ConditionTrue
})
if
err
!=
nil
{
...
...
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