clientv3: include a context in Client

Useful for clean up tasks
This commit is contained in:
Anthony Romano
2016-03-03 12:43:03 -08:00
parent 3b185f130a
commit 360aafec76
8 changed files with 47 additions and 28 deletions

View File

@ -41,7 +41,7 @@ func testMutex(t *testing.T, waiters int, chooseClient func() *clientv3.Client)
lockedC := make(chan *concurrency.Mutex, 1)
for i := 0; i < waiters; i++ {
go func() {
m := concurrency.NewMutex(context.TODO(), chooseClient(), "test-mutex")
m := concurrency.NewMutex(chooseClient(), "test-mutex")
if err := m.Lock(context.TODO()); err != nil {
t.Fatalf("could not wait on lock (%v)", err)
}