From f0fbddf010eb35a69b01c1a4cf5f367d9c7a899f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 27 Jul 2023 03:49:00 +0200 Subject: [PATCH 1/3] harden test_memory.py for use with ARROW_USE_GLOG=ON Suggested-By: Sutou Kouhei --- dev/tasks/conda-recipes/arrow-cpp/meta.yaml | 2 -- python/pyarrow/tests/test_memory.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dev/tasks/conda-recipes/arrow-cpp/meta.yaml b/dev/tasks/conda-recipes/arrow-cpp/meta.yaml index e61034c3075b3..ac4b29eb5ee7e 100644 --- a/dev/tasks/conda-recipes/arrow-cpp/meta.yaml +++ b/dev/tasks/conda-recipes/arrow-cpp/meta.yaml @@ -403,8 +403,6 @@ outputs: {% set tests_to_skip = tests_to_skip + " or test_safe_cast_from_float_with_nans_to_int" %} # [ppc64le] # gandiva tests are segfaulting on ppc {% set tests_to_skip = tests_to_skip + " or test_float_with_null_as_integer" %} # [ppc64le] - # "Unsupported backend 'nonexistent' specified in ARROW_DEFAULT_MEMORY_POOL" - {% set tests_to_skip = tests_to_skip + " or (test_memory and test_env_var)" %} # [unix] # test is broken; header is in $PREFIX, not $SP_DIR {% set tests_to_skip = tests_to_skip + " or (test_misc and test_get_include)" %} # [unix] # flaky tests that fail occasionally diff --git a/python/pyarrow/tests/test_memory.py b/python/pyarrow/tests/test_memory.py index 092c50de33b90..2854f01c7c89f 100644 --- a/python/pyarrow/tests/test_memory.py +++ b/python/pyarrow/tests/test_memory.py @@ -134,8 +134,14 @@ def check_env_var(name, expected, *, expect_warning=False): res.check_returncode() # fail errlines = res.stderr.splitlines() if expect_warning: - assert len(errlines) == 1 - assert f"Unsupported backend '{name}'" in errlines[0] + assert len(errlines) in (1, 2) + if len(errlines) == 1: + # ARROW_USE_GLOG=OFF + assert f"Unsupported backend '{name}'" in errlines[0] + else: + # ARROW_USE_GLOG=ON + assert f"InitGoogleLoggingd()" in errlines[0] + assert f"Unsupported backend '{name}'" in errlines[1] else: assert len(errlines) == 0 From 9e394b22ef8ba51c48cfc54586ee5be2025fc112 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 27 Jul 2023 15:39:58 +1100 Subject: [PATCH 2/3] fix typo --- python/pyarrow/tests/test_memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyarrow/tests/test_memory.py b/python/pyarrow/tests/test_memory.py index 2854f01c7c89f..4cedbab4a0c23 100644 --- a/python/pyarrow/tests/test_memory.py +++ b/python/pyarrow/tests/test_memory.py @@ -140,7 +140,7 @@ def check_env_var(name, expected, *, expect_warning=False): assert f"Unsupported backend '{name}'" in errlines[0] else: # ARROW_USE_GLOG=ON - assert f"InitGoogleLoggingd()" in errlines[0] + assert f"InitGoogleLogging()" in errlines[0] assert f"Unsupported backend '{name}'" in errlines[1] else: assert len(errlines) == 0 From a578195204986ea91a32a721a6da3cf8af1bb0c7 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Fri, 28 Jul 2023 10:46:23 +0900 Subject: [PATCH 3/3] Fix lint --- python/pyarrow/tests/test_memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyarrow/tests/test_memory.py b/python/pyarrow/tests/test_memory.py index 4cedbab4a0c23..d9fdeb152c35e 100644 --- a/python/pyarrow/tests/test_memory.py +++ b/python/pyarrow/tests/test_memory.py @@ -140,7 +140,7 @@ def check_env_var(name, expected, *, expect_warning=False): assert f"Unsupported backend '{name}'" in errlines[0] else: # ARROW_USE_GLOG=ON - assert f"InitGoogleLogging()" in errlines[0] + assert "InitGoogleLogging()" in errlines[0] assert f"Unsupported backend '{name}'" in errlines[1] else: assert len(errlines) == 0