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:
Alexandre Beslic 2015-06-04 18:18:51 -07:00
parent 9a8edbc9e1
commit 8142a3189e
2 changed files with 2 additions and 8 deletions

View File

@ -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)

View File

@ -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