Browse Source

fix TestV2WatchKeyInDir test

Xiang Li 12 years ago
parent
commit
3e4f8a382e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      server/v2/tests/get_handler_test.go

+ 4 - 2
server/v2/tests/get_handler_test.go

@@ -204,6 +204,9 @@ func TestV2WatchKeyInDir(t *testing.T) {
 			c <- true
 		}()
 
+		// wait for expiration, we do have a up to 500 millisecond delay
+		time.Sleep(1500 * time.Millisecond)
+
 		select {
 		case <-c:
 
@@ -215,7 +218,6 @@ func TestV2WatchKeyInDir(t *testing.T) {
 		assert.Equal(t, body["action"], "expire", "")
 
 		node := body["node"].(map[string]interface{})
-		assert.Equal(t, node["key"], "/keyindir/bar", "")
-		assert.Equal(t, node["value"], "XXX", "")
+		assert.Equal(t, node["key"], "/keyindir", "")
 	})
 }