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
b8f3095b
Commit
b8f3095b
authored
Jun 02, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26700 from deads2k/debug-flake
add logging for flake #26689
parents
a44d027e
bf225341
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
delaying_queue_test.go
pkg/util/workqueue/delaying_queue_test.go
+12
-7
No files found.
pkg/util/workqueue/delaying_queue_test.go
View file @
b8f3095b
...
@@ -43,7 +43,7 @@ func TestSimpleQueue(t *testing.T) {
...
@@ -43,7 +43,7 @@ func TestSimpleQueue(t *testing.T) {
fakeClock
.
Step
(
60
*
time
.
Millisecond
)
fakeClock
.
Step
(
60
*
time
.
Millisecond
)
if
err
:=
waitForAdded
(
q
,
1
);
err
!=
nil
{
if
err
:=
waitForAdded
(
t
,
q
,
1
);
err
!=
nil
{
t
.
Errorf
(
"should have added"
)
t
.
Errorf
(
"should have added"
)
}
}
item
,
_
:=
q
.
Get
()
item
,
_
:=
q
.
Get
()
...
@@ -88,7 +88,7 @@ func TestAddTwoFireEarly(t *testing.T) {
...
@@ -88,7 +88,7 @@ func TestAddTwoFireEarly(t *testing.T) {
fakeClock
.
Step
(
60
*
time
.
Millisecond
)
fakeClock
.
Step
(
60
*
time
.
Millisecond
)
if
err
:=
waitForAdded
(
q
,
1
);
err
!=
nil
{
if
err
:=
waitForAdded
(
t
,
q
,
1
);
err
!=
nil
{
t
.
Fatalf
(
"unexpected err: %v"
,
err
)
t
.
Fatalf
(
"unexpected err: %v"
,
err
)
}
}
item
,
_
:=
q
.
Get
()
item
,
_
:=
q
.
Get
()
...
@@ -99,7 +99,7 @@ func TestAddTwoFireEarly(t *testing.T) {
...
@@ -99,7 +99,7 @@ func TestAddTwoFireEarly(t *testing.T) {
q
.
AddAfter
(
third
,
2
*
time
.
Second
)
q
.
AddAfter
(
third
,
2
*
time
.
Second
)
fakeClock
.
Step
(
1
*
time
.
Second
)
fakeClock
.
Step
(
1
*
time
.
Second
)
if
err
:=
waitForAdded
(
q
,
1
);
err
!=
nil
{
if
err
:=
waitForAdded
(
t
,
q
,
1
);
err
!=
nil
{
t
.
Fatalf
(
"unexpected err: %v"
,
err
)
t
.
Fatalf
(
"unexpected err: %v"
,
err
)
}
}
item
,
_
=
q
.
Get
()
item
,
_
=
q
.
Get
()
...
@@ -108,7 +108,7 @@ func TestAddTwoFireEarly(t *testing.T) {
...
@@ -108,7 +108,7 @@ func TestAddTwoFireEarly(t *testing.T) {
}
}
fakeClock
.
Step
(
2
*
time
.
Second
)
fakeClock
.
Step
(
2
*
time
.
Second
)
if
err
:=
waitForAdded
(
q
,
1
);
err
!=
nil
{
if
err
:=
waitForAdded
(
t
,
q
,
1
);
err
!=
nil
{
t
.
Fatalf
(
"unexpected err: %v"
,
err
)
t
.
Fatalf
(
"unexpected err: %v"
,
err
)
}
}
item
,
_
=
q
.
Get
()
item
,
_
=
q
.
Get
()
...
@@ -139,7 +139,7 @@ func TestCopyShifting(t *testing.T) {
...
@@ -139,7 +139,7 @@ func TestCopyShifting(t *testing.T) {
fakeClock
.
Step
(
2
*
time
.
Second
)
fakeClock
.
Step
(
2
*
time
.
Second
)
if
err
:=
waitForAdded
(
q
,
3
);
err
!=
nil
{
if
err
:=
waitForAdded
(
t
,
q
,
3
);
err
!=
nil
{
t
.
Fatalf
(
"unexpected err: %v"
,
err
)
t
.
Fatalf
(
"unexpected err: %v"
,
err
)
}
}
actualFirst
,
_
:=
q
.
Get
()
actualFirst
,
_
:=
q
.
Get
()
...
@@ -156,14 +156,19 @@ func TestCopyShifting(t *testing.T) {
...
@@ -156,14 +156,19 @@ func TestCopyShifting(t *testing.T) {
}
}
}
}
func
waitForAdded
(
q
DelayingInterface
,
depth
int
)
error
{
func
waitForAdded
(
t
*
testing
.
T
,
q
DelayingInterface
,
depth
int
)
error
{
return
wait
.
Poll
(
1
*
time
.
Millisecond
,
1
0
*
time
.
Second
,
func
()
(
done
bool
,
err
error
)
{
err
:=
wait
.
Poll
(
1
*
time
.
Millisecond
,
2
0
*
time
.
Second
,
func
()
(
done
bool
,
err
error
)
{
if
q
.
Len
()
==
depth
{
if
q
.
Len
()
==
depth
{
return
true
,
nil
return
true
,
nil
}
}
return
false
,
nil
return
false
,
nil
})
})
if
err
!=
nil
{
t
.
Logf
(
"failed: len=%v, everything=%#v"
,
q
.
Len
(),
q
)
}
return
err
}
}
func
waitForWaitingQueueToFill
(
q
DelayingInterface
)
error
{
func
waitForWaitingQueueToFill
(
q
DelayingInterface
)
error
{
...
...
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