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
880ecef6
Commit
880ecef6
authored
Jan 07, 2015
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move locks on watch to allow testing blocking
parent
31fc19ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
fake_etcd_client.go
pkg/tools/fake_etcd_client.go
+3
-1
No files found.
pkg/tools/fake_etcd_client.go
View file @
880ecef6
...
...
@@ -131,7 +131,7 @@ func (f *FakeEtcdClient) Get(key string, sort, recursive bool) (*etcd.Response,
}
return
&
etcd
.
Response
{},
EtcdErrorNotFound
}
f
.
t
.
Logf
(
"returning %v: %v %#v"
,
key
,
result
.
R
,
result
.
E
)
f
.
t
.
Logf
(
"returning %v: %
#
v %#v"
,
key
,
result
.
R
,
result
.
E
)
return
result
.
R
,
result
.
E
}
...
...
@@ -262,6 +262,7 @@ func (f *FakeEtcdClient) WaitForWatchCompletion() {
}
func
(
f
*
FakeEtcdClient
)
Watch
(
prefix
string
,
waitIndex
uint64
,
recursive
bool
,
receiver
chan
*
etcd
.
Response
,
stop
chan
bool
)
(
*
etcd
.
Response
,
error
)
{
f
.
Mutex
.
Lock
()
if
f
.
WatchImmediateError
!=
nil
{
return
nil
,
f
.
WatchImmediateError
}
...
...
@@ -273,6 +274,7 @@ func (f *FakeEtcdClient) Watch(prefix string, waitIndex uint64, recursive bool,
defer
close
(
injectedError
)
f
.
WatchInjectError
=
injectedError
f
.
Mutex
.
Unlock
()
if
receiver
==
nil
{
return
f
.
Get
(
prefix
,
false
,
recursive
)
}
else
{
...
...
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