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
7feb6640
Commit
7feb6640
authored
Jan 10, 2016
by
James DeFelice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #19186
parent
9856ed8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
util_test.go
contrib/mesos/pkg/runtime/util_test.go
+18
-6
No files found.
contrib/mesos/pkg/runtime/util_test.go
View file @
7feb6640
...
...
@@ -39,25 +39,37 @@ func TestUntil(t *testing.T) {
<-
called
close
(
ch
)
<-
called
// wait for 'called' to be closed
for
{
if
_
,
ok
:=
<-
called
;
!
ok
{
break
}
}
//--
ch
=
make
(
chan
struct
{})
called
=
make
(
chan
struct
{})
called
2
:
=
make
(
chan
struct
{})
running
:=
make
(
chan
struct
{})
After
(
func
()
{
Until
(
func
()
{
close
(
running
)
called
<-
struct
{}{}
called
2
<-
struct
{}{}
},
2
*
time
.
Second
,
ch
)
})
.
Then
(
func
()
{
close
(
called
)
})
})
.
Then
(
func
()
{
close
(
called
2
)
})
<-
running
close
(
ch
)
<-
called
// unblock the goroutine
<-
called
2
// unblock the goroutine
now
:=
time
.
Now
()
<-
called
// wait for 'called2' to be closed
for
{
if
_
,
ok
:=
<-
called2
;
!
ok
{
break
}
}
if
time
.
Since
(
now
)
>
1800
*
time
.
Millisecond
{
t
.
Fatalf
(
"Until should not have waited the full timeout period since we closed the stop chan"
)
}
...
...
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