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
5cf06595
Commit
5cf06595
authored
Dec 28, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19131 from wojtek-t/fix_close_channel
Auto commit by PR queue bot
parents
89a40936
0b7dce95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
etcd_watcher_test.go
pkg/storage/etcd/etcd_watcher_test.go
+9
-2
No files found.
pkg/storage/etcd/etcd_watcher_test.go
View file @
5cf06595
...
@@ -462,8 +462,15 @@ func TestWatchPurposefulShutdown(t *testing.T) {
...
@@ -462,8 +462,15 @@ func TestWatchPurposefulShutdown(t *testing.T) {
watching
.
Stop
()
watching
.
Stop
()
rt
.
Gosched
()
rt
.
Gosched
()
if
_
,
open
:=
<-
watching
.
ResultChan
();
open
{
// There is a race in etcdWatcher so that after calling Stop() one of
t
.
Errorf
(
"Channel should be closed"
)
// two things can happen:
// - ResultChan() may be closed (triggered by closing userStop channel)
// - an Error "context cancelled" may be emitted (triggered by cancelling request
// to etcd and putting that error to etcdError channel)
// We need to be prepared for both here.
event
,
open
:=
<-
watching
.
ResultChan
()
if
open
&&
event
.
Type
!=
watch
.
Error
{
t
.
Errorf
(
"Unexpected event from stopped watcher: %#v"
,
event
)
}
}
}
}
...
...
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