Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
improve cover
Browse files Browse the repository at this point in the history
  • Loading branch information
yaronsumel committed Jul 29, 2017
1 parent 737c0a5 commit 487d0a1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions zk/lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ func TestTryLock(t *testing.T) {
if err := l.Unlock(); err != nil {
t.Fatal(err)
}
// lock to create timeout
if err := l.Lock(); err != nil {
t.Fatal(err)
}
go func() {
// lock to create timeout
if err := l.Lock(); err != nil {
t.Fatal(err)
}
time.Sleep(time.Second * 10)
if err := l.Unlock(); err != nil {
t.Fatal(err)
}
}()
if err := l.TryLock(time.Second); err == nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 487d0a1

Please sign in to comment.