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
bee58229
Commit
bee58229
authored
Dec 22, 2015
by
Mike Danese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19010 from wojtek-t/debug_watcher_test
Fix etcdWatcher test
parents
b174fc9c
8cd50dd0
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 @
bee58229
...
...
@@ -266,8 +266,15 @@ func TestWatch(t *testing.T) {
watching
.
Stop
()
if
_
,
open
:=
<-
watching
.
ResultChan
();
open
{
t
.
Errorf
(
"An injected error did not cause a graceful shutdown"
)
// There is a race in etcdWatcher so that after calling Stop() one of
// 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