@@ -44,6 +44,9 @@ import (
4444 "github.com/cloudwego/kitex/pkg/http"
4545 "github.com/cloudwego/kitex/pkg/loadbalance"
4646 "github.com/cloudwego/kitex/pkg/proxy"
47+ connpool2 "github.com/cloudwego/kitex/pkg/remote/connpool"
48+ "github.com/cloudwego/kitex/pkg/remote/trans/gonet"
49+ "github.com/cloudwego/kitex/pkg/remote/trans/netpoll"
4750 "github.com/cloudwego/kitex/pkg/remote/trans/nphttp2/grpc"
4851 "github.com/cloudwego/kitex/pkg/retry"
4952 "github.com/cloudwego/kitex/pkg/rpcinfo"
@@ -764,6 +767,20 @@ func TestTailOption(t *testing.T) {
764767 test .Assert (t , opts .RemoteOpt .Dialer != nil )
765768}
766769
770+ func TestGonetOption (t * testing.T ) {
771+ // gonet
772+ opt := client .NewOptions ([]Option {WithDialer (gonet .NewDialer ()), WithLongConnection (connpool.IdleConfig {MaxIdlePerAddress : 10 })})
773+ d := opt .RemoteOpt .ConnPool .(* connpool2.LongPool )
774+ pcfg := d .Config ()
775+ test .Assert (t , pcfg .Enable )
776+
777+ // netpoll
778+ opt = client .NewOptions ([]Option {WithDialer (netpoll .NewDialer ()), WithLongConnection (connpool.IdleConfig {MaxIdlePerAddress : 10 })})
779+ d = opt .RemoteOpt .ConnPool .(* connpool2.LongPool )
780+ pcfg = d .Config ()
781+ test .Assert (t , ! pcfg .Enable )
782+ }
783+
767784func checkOneOptionDebugInfo (t * testing.T , opt Option , expectStr string ) error {
768785 o := & Options {}
769786 o .Apply ([]Option {opt })
0 commit comments