simplify lock

This commit is contained in:
Xiang Li
2013-09-30 23:18:52 -07:00
parent d2407dff9f
commit 558d30f33f
3 changed files with 14 additions and 36 deletions

View File

@ -244,7 +244,7 @@ func TestExpire(t *testing.T) {
s.Create("/foo", "bar", expire, 1, 1)
_, err := s.internalGet("/foo", 1, 1)
_, err := s.Get("/foo", false, false, 1, 1)
if err != nil {
t.Fatalf("can not get the node")
@ -252,7 +252,7 @@ func TestExpire(t *testing.T) {
time.Sleep(time.Second * 2)
_, err = s.internalGet("/foo", 1, 1)
_, err = s.Get("/foo", false, false, 1, 1)
if err == nil {
t.Fatalf("can get the node after expiration time")
@ -263,7 +263,7 @@ func TestExpire(t *testing.T) {
s.Create("/foo", "bar", expire, 1, 1)
time.Sleep(time.Millisecond * 50)
_, err = s.internalGet("/foo", 1, 1)
_, err = s.Get("/foo", false, false, 1, 1)
if err != nil {
t.Fatalf("cannot get the node before expiration", err.Error())