| 77 | ASSERT_OK(server->Shutdown()); |
| 78 | } |
| 79 | void ConnectivityTest::TestShutdown() { |
| 80 | // Regression test for ARROW-15181 |
| 81 | constexpr int kIterations = 10; |
| 82 | ASSERT_OK_AND_ASSIGN(auto location, Location::ForScheme(transport(), "127.0.0.1", 0)); |
| 83 | for (int i = 0; i < kIterations; i++) { |
| 84 | std::unique_ptr<FlightServerBase> server = TestFlightServer::Make(); |
| 85 | |
| 86 | FlightServerOptions options(location); |
| 87 | ASSERT_OK(server->Init(options)); |
| 88 | ASSERT_GT(server->port(), 0); |
| 89 | std::thread t([&]() { ASSERT_OK(server->Serve()); }); |
| 90 | ASSERT_OK(server->Shutdown()); |
| 91 | ASSERT_OK(server->Wait()); |
| 92 | t.join(); |
| 93 | } |
| 94 | } |
| 95 | void ConnectivityTest::TestShutdownWithDeadline() { |
| 96 | std::unique_ptr<FlightServerBase> server = TestFlightServer::Make(); |
| 97 | |