Skip to content
/ etcd Public
forked from etcd-io/etcd

Commit

Permalink
testing semaphore
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuho committed Jan 20, 2016
1 parent b0e9591 commit 12f27f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions integration/v3_grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ func TestV3WatchMultipleEventsFromUnsynced(t *testing.T) {
Kv: &storagepb.KeyValue{Key: []byte("foo1"), Value: []byte("bar"), CreateRevision: 3, ModRevision: 5, Version: 2},
},
}
st := time.Now()
lastEvents := []*storagepb.Event{}
for len(lastEvents) < 2 {
resp, err := wStream.Recv()
Expand All @@ -705,13 +706,16 @@ func TestV3WatchMultipleEventsFromUnsynced(t *testing.T) {
continue
}
lastEvents = append(lastEvents, resp.Events...)
fmt.Println("lastEvents adding:", resp.Events)
}
fmt.Println("lastEvents loop done... took", time.Since(st))
sort.Sort(eventsSortByKey(lastEvents))

if !reflect.DeepEqual(lastEvents, lastWevents) {
t.Errorf("lastEvents got = %+v, want = %+v", lastEvents, lastWevents)
}

fmt.Println("wait...")
rok, nr := WaitResponse(wStream, 1*time.Second)
if !rok {
t.Errorf("unexpected pb.WatchResponse is received %+v", nr)
Expand Down

0 comments on commit 12f27f7

Please sign in to comment.