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
ab58e723
Commit
ab58e723
authored
Jan 02, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19226 from wojtek-t/fix_test_poll
Fix TestPoll test
parents
b4189f96
84e2d6c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
wait_test.go
pkg/util/wait/wait_test.go
+7
-8
No files found.
pkg/util/wait/wait_test.go
View file @
ab58e723
...
...
@@ -84,7 +84,7 @@ func TestPoll(t *testing.T) {
return
true
,
nil
})
fp
:=
fakePoller
{
max
:
1
}
if
err
:=
pollInternal
(
fp
.
GetWaitFunc
(
time
.
Microsecond
,
time
.
Micros
econd
),
f
);
err
!=
nil
{
if
err
:=
pollInternal
(
fp
.
GetWaitFunc
(
time
.
Microsecond
,
time
.
S
econd
),
f
);
err
!=
nil
{
t
.
Fatalf
(
"unexpected error %v"
,
err
)
}
if
invocations
!=
1
{
...
...
@@ -94,19 +94,18 @@ func TestPoll(t *testing.T) {
if
used
!=
1
{
t
.
Errorf
(
"Expected exactly one tick, got %d"
,
used
)
}
}
func
TestPollError
(
t
*
testing
.
T
)
{
expectedError
:=
errors
.
New
(
"Expected error"
)
f
=
ConditionFunc
(
func
()
(
bool
,
error
)
{
f
:
=
ConditionFunc
(
func
()
(
bool
,
error
)
{
return
false
,
expectedError
})
fp
=
fakePoller
{
max
:
1
}
if
err
:=
pollInternal
(
fp
.
GetWaitFunc
(
time
.
Microsecond
,
time
.
Micros
econd
),
f
);
err
==
nil
||
err
!=
expectedError
{
fp
:
=
fakePoller
{
max
:
1
}
if
err
:=
pollInternal
(
fp
.
GetWaitFunc
(
time
.
Microsecond
,
time
.
S
econd
),
f
);
err
==
nil
||
err
!=
expectedError
{
t
.
Fatalf
(
"Expected error %v, got none %v"
,
expectedError
,
err
)
}
if
invocations
!=
1
{
t
.
Errorf
(
"Expected exactly one invocation, got %d"
,
invocations
)
}
used
=
atomic
.
LoadInt32
(
&
fp
.
used
)
used
:=
atomic
.
LoadInt32
(
&
fp
.
used
)
if
used
!=
1
{
t
.
Errorf
(
"Expected exactly one tick, got %d"
,
used
)
}
...
...
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