pitrou commented on a change in pull request #12628:
URL: https://github.com/apache/arrow/pull/12628#discussion_r826918949



##########
File path: cpp/src/arrow/flight/flight_test.cc
##########
@@ -81,6 +81,7 @@ TEST_F(GrpcConnectivityTest, GetPort) { TestGetPort(); }
 TEST_F(GrpcConnectivityTest, BuilderHook) { TestBuilderHook(); }
 TEST_F(GrpcConnectivityTest, Shutdown) { TestShutdown(); }
 TEST_F(GrpcConnectivityTest, ShutdownWithDeadline) { 
TestShutdownWithDeadline(); }
+TEST_F(GrpcConnectivityTest, BrokenConnection) { TestBrokenConnection(); }

Review comment:
       Are these definitions meant to be repeated for each backend? If so, 
should there be a convenience macro so that none of them is forgotten?

##########
File path: cpp/src/arrow/flight/test_definitions.cc
##########
@@ -91,6 +91,23 @@ void ConnectivityTest::TestShutdownWithDeadline() {
   ASSERT_OK(server->Shutdown(&deadline));
   ASSERT_OK(server->Wait());
 }
+void ConnectivityTest::TestBrokenConnection() {
+  std::unique_ptr<FlightServerBase> server = ExampleTestServer();
+  ASSERT_OK_AND_ASSIGN(auto location, Location::ForScheme(transport(), 
"localhost", 0));
+  FlightServerOptions options(location);
+  ASSERT_OK(server->Init(options));
+
+  std::unique_ptr<FlightClient> client;
+  ASSERT_OK_AND_ASSIGN(location,
+                       Location::ForScheme(transport(), "localhost", 
server->port()));
+  ASSERT_OK(FlightClient::Connect(location, &client));
+
+  ASSERT_OK(server->Shutdown());
+  ASSERT_OK(server->Wait());
+
+  std::unique_ptr<FlightInfo> info;
+  ASSERT_FALSE(client->GetFlightInfo(FlightDescriptor::Command(""), 
&info).ok());

Review comment:
       Should we test for a specific status code here (IOError perhaps)?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to