From 2f2b408686bf5d0a7154341dae4e7bca339f8d57 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Thu, 14 Jan 2016 21:26:13 -0800 Subject: [PATCH] integration: test header revision in v3 grpc Related https://github.com/coreos/etcd/issues/4216. --- integration/v3_grpc_test.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/integration/v3_grpc_test.go b/integration/v3_grpc_test.go index 50c4dcc7a..5c1688060 100644 --- a/integration/v3_grpc_test.go +++ b/integration/v3_grpc_test.go @@ -215,12 +215,12 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { Created: true, }, { - Header: &pb.ResponseHeader{Revision: 1}, + Header: &pb.ResponseHeader{Revision: 2}, Created: false, Events: []*storagepb.Event{ { Type: storagepb.PUT, - Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 1, ModRevision: 1, Version: 1}, + Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}, }, }, }, @@ -249,12 +249,12 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { Created: true, }, { - Header: &pb.ResponseHeader{Revision: 1}, + Header: &pb.ResponseHeader{Revision: 2}, Created: false, Events: []*storagepb.Event{ { Type: storagepb.PUT, - Kv: &storagepb.KeyValue{Key: []byte("fooLong"), Value: []byte("bar"), CreateRevision: 1, ModRevision: 1, Version: 1}, + Kv: &storagepb.KeyValue{Key: []byte("fooLong"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}, }, }, }, @@ -283,32 +283,32 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { Created: true, }, { - Header: &pb.ResponseHeader{Revision: 1}, + Header: &pb.ResponseHeader{Revision: 2}, Created: false, Events: []*storagepb.Event{ { Type: storagepb.PUT, - Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 1, ModRevision: 1, Version: 1}, + Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}, }, }, }, { - Header: &pb.ResponseHeader{Revision: 1}, + Header: &pb.ResponseHeader{Revision: 3}, Created: false, Events: []*storagepb.Event{ { Type: storagepb.PUT, - Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 1, ModRevision: 2, Version: 2}, + Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 3, Version: 2}, }, }, }, { - Header: &pb.ResponseHeader{Revision: 1}, + Header: &pb.ResponseHeader{Revision: 4}, Created: false, Events: []*storagepb.Event{ { Type: storagepb.PUT, - Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 1, ModRevision: 3, Version: 3}, + Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 4, Version: 3}, }, }, }, @@ -325,32 +325,32 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { Created: true, }, { - Header: &pb.ResponseHeader{Revision: 1}, + Header: &pb.ResponseHeader{Revision: 2}, Created: false, Events: []*storagepb.Event{ { Type: storagepb.PUT, - Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 1, ModRevision: 1, Version: 1}, + Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}, }, }, }, { - Header: &pb.ResponseHeader{Revision: 1}, + Header: &pb.ResponseHeader{Revision: 3}, Created: false, Events: []*storagepb.Event{ { Type: storagepb.PUT, - Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 1, ModRevision: 2, Version: 2}, + Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 3, Version: 2}, }, }, }, { - Header: &pb.ResponseHeader{Revision: 1}, + Header: &pb.ResponseHeader{Revision: 4}, Created: false, Events: []*storagepb.Event{ { Type: storagepb.PUT, - Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 1, ModRevision: 3, Version: 3}, + Kv: &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 4, Version: 3}, }, }, }, @@ -391,7 +391,7 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { t.Fatalf("#%d.%d: unexpected nil resp.Header", i, j) } if resp.Header.Revision != wresp.Header.Revision { - t.Logf("[TODO - skip for now] #%d.%d: resp.Header.Revision got = %d, want = %d", i, j, resp.Header.Revision, wresp.Header.Revision) + t.Errorf("#%d.%d: resp.Header.Revision got = %d, want = %d", i, j, resp.Header.Revision, wresp.Header.Revision) } if wresp.Created != resp.Created {