mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: set 10x the keys in test
This commit is contained in:
parent
97ee4dc847
commit
e9bb7c26fa
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user