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
55f91483
Commit
55f91483
authored
May 20, 2016
by
Jan Safranek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase goroutinemap unit test timeouts.
50ms is flaky in Jenkins. Fixes #25825
parent
ab104843
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
goroutinemap_test.go
pkg/util/goroutinemap/goroutinemap_test.go
+8
-11
No files found.
pkg/util/goroutinemap/goroutinemap_test.go
View file @
55f91483
...
...
@@ -24,6 +24,11 @@ import (
"k8s.io/kubernetes/pkg/util/wait"
)
// testTimeout is a timeout of goroutines to finish. This _should_ be just a
// "context switch" and it should take several ms, however, Clayton says "We
// have had flakes due to tests that assumed that 15s is long enough to sleep")
const
testTimeout
=
1
*
time
.
Minute
func
Test_NewGoRoutineMap_Positive_SingleOp
(
t
*
testing
.
T
)
{
// Arrange
grm
:=
NewGoRoutineMap
()
...
...
@@ -210,8 +215,7 @@ func Test_NewGoRoutineMap_Positive_WaitEmpty(t *testing.T) {
}()
// Assert
// Tolerate 50 milliseconds for goroutine context switches etc.
err
:=
waitChannelWithTimeout
(
waitDoneCh
,
50
*
time
.
Millisecond
)
err
:=
waitChannelWithTimeout
(
waitDoneCh
,
testTimeout
)
if
err
!=
nil
{
t
.
Errorf
(
"Error waiting for GoRoutineMap.Wait: %v"
,
err
)
}
...
...
@@ -236,18 +240,11 @@ func Test_NewGoRoutineMap_Positive_Wait(t *testing.T) {
waitDoneCh
<-
true
}()
// Assert
// Check that Wait() really blocks
err
=
waitChannelWithTimeout
(
waitDoneCh
,
100
*
time
.
Millisecond
)
if
err
==
nil
{
t
.
Fatalf
(
"Expected Wait() to block but it returned early"
)
}
// Finish the operation
operation1DoneCh
<-
true
//
check that Wait() finishes in reasonable time
err
=
waitChannelWithTimeout
(
waitDoneCh
,
50
*
time
.
Millisecond
)
//
Assert
err
=
waitChannelWithTimeout
(
waitDoneCh
,
testTimeout
)
if
err
!=
nil
{
t
.
Fatalf
(
"Error waiting for GoRoutineMap.Wait: %v"
,
err
)
}
...
...
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