You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by fs...@apache.org on 2020/05/29 14:08:28 UTC

[arrow] branch master updated: ARROW-8975: [FlightRPC][C++] try to fix MacOS flaky tests

This is an automated email from the ASF dual-hosted git repository.

fsaintjacques pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 21a6474  ARROW-8975: [FlightRPC][C++] try to fix MacOS flaky tests
21a6474 is described below

commit 21a6474fd6e4b5c0444d8364ebfdefcf856ef7fd
Author: David Li <li...@gmail.com>
AuthorDate: Fri May 29 10:08:05 2020 -0400

    ARROW-8975: [FlightRPC][C++] try to fix MacOS flaky tests
    
    This seems OK in CI and should speed up the build as we no longer have to compile Protobuf and gRPC. I'm still a bit bothered since it's unclear upstream whether the root issue is truly fixed or not; if we see any more failures, we should just disable tests using TLS entirely on MacOS.
    
    Closes #7298 from lidavidm/grpc-macos
    
    Authored-by: David Li <li...@gmail.com>
    Signed-off-by: François Saint-Jacques <fs...@gmail.com>
---
 .github/workflows/cpp.yml                   |  9 ---------
 cpp/cmake_modules/ThirdpartyToolchain.cmake |  5 ++++-
 cpp/src/arrow/flight/CMakeLists.txt         |  3 ++-
 cpp/src/arrow/flight/flight_test.cc         | 19 ++++++++++++-------
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml
index d9b9452..dca34ae 100644
--- a/.github/workflows/cpp.yml
+++ b/.github/workflows/cpp.yml
@@ -116,10 +116,6 @@ jobs:
       ARROW_WITH_SNAPPY: ON
       ARROW_WITH_BROTLI: ON
       ARROW_BUILD_TESTS: ON
-      # ARROW-7551: for now, build without Homebrew gRPC, as gRPC
-      # 1.26.0 is broken. https://github.com/grpc/grpc/pull/21662
-      gRPC_SOURCE: BUNDLED
-      Protobuf_SOURCE: BUNDLED
     steps:
       - name: Checkout Arrow
         uses: actions/checkout@v2
@@ -131,11 +127,6 @@ jobs:
       - name: Install Dependencies
         shell: bash
         run: brew bundle --file=cpp/Brewfile
-        # ARROW-7551: for now, build without Homebrew gRPC, as gRPC
-        # 1.26.0 is broken. https://github.com/grpc/grpc/pull/21662
-      - name: Uninstall Problematic Homebrew Dependencies
-        shell: bash
-        run: brew uninstall grpc protobuf
       - name: Build
         shell: bash
         run: ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 1eab99c..88e7f29 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -198,6 +198,8 @@ endif()
 
 if(ARROW_FLIGHT)
   set(ARROW_WITH_GRPC ON)
+  # gRPC requires zlib
+  set(ARROW_WITH_ZLIB ON)
 endif()
 
 if(ARROW_JSON)
@@ -2045,7 +2047,8 @@ macro(build_grpc)
     add_dependencies(grpc_dependencies gflags_ep)
   endif()
 
-  add_dependencies(grpc_dependencies ${ARROW_PROTOBUF_LIBPROTOBUF} c-ares::cares)
+  add_dependencies(grpc_dependencies ${ARROW_PROTOBUF_LIBPROTOBUF} c-ares::cares
+                   ZLIB::ZLIB)
 
   get_target_property(GRPC_PROTOBUF_INCLUDE_DIR ${ARROW_PROTOBUF_LIBPROTOBUF}
                       INTERFACE_INCLUDE_DIRECTORIES)
diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt
index 95d05a6..954693e 100644
--- a/cpp/src/arrow/flight/CMakeLists.txt
+++ b/cpp/src/arrow/flight/CMakeLists.txt
@@ -24,7 +24,8 @@ set(ARROW_FLIGHT_STATIC_LINK_LIBS
     gRPC::grpc++
     gRPC::grpc
     gRPC::gpr
-    c-ares::cares)
+    c-ares::cares
+    ZLIB::ZLIB)
 
 if(WIN32)
   list(APPEND ARROW_FLIGHT_STATIC_LINK_LIBS ws2_32.lib)
diff --git a/cpp/src/arrow/flight/flight_test.cc b/cpp/src/arrow/flight/flight_test.cc
index fc80051..1941d64 100644
--- a/cpp/src/arrow/flight/flight_test.cc
+++ b/cpp/src/arrow/flight/flight_test.cc
@@ -559,6 +559,14 @@ class TestDoPut : public ::testing::Test {
 class TestTls : public ::testing::Test {
  public:
   void SetUp() {
+    // Manually initialize gRPC to try to ensure some thread-locals
+    // get initialized.
+    // https://github.com/grpc/grpc/issues/13856
+    // https://github.com/grpc/grpc/issues/20311
+    // In general, gRPC on MacOS struggles with TLS (both in the sense
+    // of thread-locals and encryption)
+    grpc_init();
+
     server_.reset(new TlsTestServer);
 
     Location location;
@@ -572,7 +580,10 @@ class TestTls : public ::testing::Test {
     ASSERT_OK(ConnectClient());
   }
 
-  void TearDown() { ASSERT_OK(server_->Shutdown()); }
+  void TearDown() {
+    ASSERT_OK(server_->Shutdown());
+    grpc_shutdown();
+  }
 
   Status ConnectClient() {
     auto options = FlightClientOptions();
@@ -1556,13 +1567,7 @@ TEST_F(TestBasicAuthHandler, CheckPeerIdentity) {
   ASSERT_EQ(result->body->ToString(), "user");
 }
 
-#ifdef __APPLE__
-// ARROW-7701: this test is flaky on MacOS and segfaults (due to gRPC
-// bug?)
-TEST_F(TestTls, DISABLED_DoAction) {
-#else
 TEST_F(TestTls, DoAction) {
-#endif
   FlightCallOptions options;
   options.timeout = TimeoutDuration{5.0};
   Action action;