mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
integration: Fix 'go test --tags cluster_proxy --timeout=30m -v ./integration/...'
grpc proxy opens additional 2 watching channels. The metric is shared between etcd-server & grpc_proxy, so all assertions on number of open watch channels need to take in consideration the additional "2" channels.
This commit is contained in:
@@ -23,6 +23,8 @@ import (
|
||||
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
||||
)
|
||||
|
||||
const throughProxy = false
|
||||
|
||||
func toGRPC(c *clientv3.Client) grpcAPI {
|
||||
return grpcAPI{
|
||||
pb.NewClusterClient(c.ActiveConnection()),
|
||||
|
||||
@@ -25,6 +25,8 @@ import (
|
||||
"go.etcd.io/etcd/proxy/grpcproxy/adapter"
|
||||
)
|
||||
|
||||
const throughProxy = true
|
||||
|
||||
var (
|
||||
pmu sync.Mutex
|
||||
proxies map[*clientv3.Client]grpcClientProxy = make(map[*clientv3.Client]grpcClientProxy)
|
||||
|
||||
@@ -1241,7 +1241,15 @@ func TestV3WatchCancellation(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if minWatches != "1" {
|
||||
t.Fatalf("expected one watch, got %s", minWatches)
|
||||
var expected string
|
||||
if throughProxy {
|
||||
// grpc proxy has additional 2 watches open
|
||||
expected = "3"
|
||||
} else {
|
||||
expected = "1"
|
||||
}
|
||||
|
||||
if minWatches != expected {
|
||||
t.Fatalf("expected %s watch, got %s", expected, minWatches)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user