@@ -10,6 +10,8 @@ defmodule GRPC.ChannelTest do
1010 GRPC.Stub . connect ( "http://#{ unquote ( addr ) } :50051" , adapter: ClientAdapter )
1111
1212 assert % Channel { host: unquote ( addr ) , port: 50051 , scheme: "http" , cred: nil } = channel
13+
14+ assert { :ok , _ } = GRPC.Stub . disconnect ( channel )
1315 end
1416
1517 test "errors if credential is provided" do
@@ -31,6 +33,8 @@ defmodule GRPC.ChannelTest do
3133 assert Keyword . has_key? ( cred . ssl , :verify )
3234 assert Keyword . has_key? ( cred . ssl , :depth )
3335 assert Keyword . has_key? ( cred . ssl , :cacert_file )
36+
37+ assert { :ok , _ } = GRPC.Stub . disconnect ( channel )
3438 end
3539
3640 test "allows overriding default credentials" do
@@ -40,13 +44,17 @@ defmodule GRPC.ChannelTest do
4044 GRPC.Stub . connect ( "https://#{ unquote ( addr ) } :50051" , adapter: ClientAdapter , cred: cred )
4145
4246 assert % Channel { host: unquote ( addr ) , port: 50051 , scheme: "https" , cred: ^ cred } = channel
47+
48+ assert { :ok , _ } = GRPC.Stub . disconnect ( channel )
4349 end
4450 end
4551
4652 describe "connect/2 with no scheme, #{ kind } and" do
4753 test "no cred uses http" do
4854 { :ok , channel } = GRPC.Stub . connect ( "#{ unquote ( addr ) } :50051" , adapter: ClientAdapter )
4955 assert % Channel { host: unquote ( addr ) , port: 50051 , scheme: "http" , cred: nil } = channel
56+
57+ assert { :ok , _ } = GRPC.Stub . disconnect ( channel )
5058 end
5159
5260 test "cred uses https" do
@@ -56,6 +64,8 @@ defmodule GRPC.ChannelTest do
5664 GRPC.Stub . connect ( "#{ unquote ( addr ) } :50051" , adapter: ClientAdapter , cred: cred )
5765
5866 assert % Channel { host: unquote ( addr ) , port: 50051 , scheme: "https" , cred: ^ cred } = channel
67+
68+ assert { :ok , _ } = GRPC.Stub . disconnect ( channel )
5969 end
6070 end
6171 end
@@ -67,5 +77,7 @@ defmodule GRPC.ChannelTest do
6777 GRPC.Stub . connect ( "http://10.0.0.1:50051" , adapter: ClientAdapter , headers: headers )
6878
6979 assert % Channel { host: "10.0.0.1" , port: 50051 , headers: ^ headers } = channel
80+
81+ assert { :ok , _ } = GRPC.Stub . disconnect ( channel )
7082 end
7183end
0 commit comments