@@ -108,6 +108,37 @@ function test_exception()
108108 @test_throws ArgumentError RouteGuideBlockingClient (" https://localhost:30000" ; maxage= - 1 )
109109end
110110
111+ function test_large_payload (client:: RouteGuideBlockingClient )
112+ @sync begin
113+ long_message1 = " Long message 1 - " * randstring (1000 )
114+ long_message2 = " Long message 2 - " * randstring (5000 )
115+
116+ notes = RouteguideClients. RouteNote[
117+ RouteguideClients. RouteNote (;location= RouteguideClients. Point (;latitude= 0 , longitude= 1 ), message= long_message1),
118+ RouteguideClients. RouteNote (;location= RouteguideClients. Point (;latitude= 0 , longitude= 2 ), message= long_message2),
119+ ]
120+ @debug (" long messages in route chat" )
121+ in_channel = Channel {RouteguideClients.RouteNote} (1 )
122+ @async begin
123+ for note in notes
124+ put! (in_channel, note)
125+ end
126+ close (in_channel)
127+ end
128+ out_channel, status_future = RouteguideClients. RouteChat (client, in_channel)
129+ nreceived = 0
130+ for note in out_channel
131+ nreceived += 1
132+ @debug (" received long note $note " )
133+ end
134+ gRPCCheck (status_future)
135+ @test nreceived > 0
136+ @test isa (out_channel, Channel{RouteguideClients. RouteNote})
137+ @test ! isopen (out_channel)
138+ @test ! isopen (in_channel)
139+ end
140+ end
141+
111142function test_message_length_limit (server_endpoint)
112143 point = RouteguideClients. Point (; latitude= 409146138 , longitude= - 746188906 )
113144
@@ -158,6 +189,9 @@ function test_blocking_client(server_endpoint::String)
158189 @testset " streaming send recv" begin
159190 test_route_chat (client)
160191 end
192+ @testset " large payloads" begin
193+ test_large_payload (client)
194+ end
161195 @testset " error handling" begin
162196 test_exception ()
163197 end
0 commit comments