etcdserver: set 10x the keys in test

This commit is contained in:
Blake Mizerany 2014-08-29 15:58:47 -07:00 committed by Yicheng Qin
parent 97ee4dc847
commit e9bb7c26fa

View File

@ -53,27 +53,29 @@ func testServer(t *testing.T, ns int64) {
t.Fatal(err)
}
r := pb.Request{
Method: "PUT",
Id: 1,
Path: "/foo",
Val: "bar",
}
resp, err := srv.Do(ctx, r)
if err != nil {
t.Fatal(err)
}
for i := 1; i <= 10; i++ {
r := pb.Request{
Method: "PUT",
Id: 1,
Path: "/foo",
Val: "bar",
}
resp, err := srv.Do(ctx, r)
if err != nil {
t.Fatal(err)
}
g, w := resp.Event.Node, &store.NodeExtern{
Key: "/foo",
ModifiedIndex: 1,
CreatedIndex: 1,
Value: stringp("bar"),
}
g, w := resp.Event.Node, &store.NodeExtern{
Key: "/foo",
ModifiedIndex: uint64(i),
CreatedIndex: uint64(i),
Value: stringp("bar"),
}
if !reflect.DeepEqual(g, w) {
t.Error("value:", *g.Value)
t.Errorf("g = %+v, w %+v", g, w)
if !reflect.DeepEqual(g, w) {
t.Error("value:", *g.Value)
t.Errorf("g = %+v, w %+v", g, w)
}
}
time.Sleep(10 * time.Millisecond)