mirror of https://github.com/docker/docs.git
return placeholder chan for zookeeper lock, remove check in Lock/Unlock test
Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
parent
9a8edbc9e1
commit
8142a3189e
|
@ -222,13 +222,7 @@ func testLockUnlock(t *testing.T, kv Store) {
|
|||
// Lock should successfully succeed or block
|
||||
lockChan, err := lock.Lock()
|
||||
assert.NoError(t, err)
|
||||
|
||||
// If Zookeeper, chan is Nil and its OK
|
||||
if _, ok := kv.(*Zookeeper); ok {
|
||||
assert.Nil(t, lockChan)
|
||||
} else {
|
||||
assert.NotNil(t, lockChan)
|
||||
}
|
||||
assert.NotNil(t, lockChan)
|
||||
|
||||
// Get should work
|
||||
pair, err := kv.Get(key)
|
||||
|
|
|
@ -296,7 +296,7 @@ func (l *zookeeperLock) Lock() (<-chan struct{}, error) {
|
|||
_, err = l.client.Set(l.key, l.value, -1)
|
||||
}
|
||||
|
||||
return nil, err
|
||||
return make(chan struct{}), err
|
||||
}
|
||||
|
||||
// Unlock released the lock. It is an error to call this
|
||||
|
|
Loading…
Reference in New Issue