You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Dmitry Kalinkin (Jira)" <ji...@apache.org> on 2021/01/27 01:09:00 UTC

[jira] [Created] (ARROW-11393) [C++][Python] check_env_var(expect_warning=True) is broken for arrow-cpp built with glog

Dmitry Kalinkin created ARROW-11393:
---------------------------------------

             Summary: [C++][Python] check_env_var(expect_warning=True) is broken for arrow-cpp built with glog
                 Key: ARROW-11393
                 URL: https://issues.apache.org/jira/browse/ARROW-11393
             Project: Apache Arrow
          Issue Type: Bug
    Affects Versions: 3.0.0
         Environment: /nix/store/fjh03l6wci3n6g5gzdnr7syy3dxndx3m-boost-1.69.0-dev
/nix/store/29w4qlhz1yc71z9ygf1ik4v6cccljzxx-brotli-1.0.9-dev
/nix/store/qkihnivbf7sz6xd17202brgfdrdbg002-flatbuffers-1.12.0
/nix/store/nhql3yn0m76nbysy8wi9kh8j3j5zh2k1-gflags-2.2.2
/nix/store/41c2nz9gkaqdmba026qhfa4kgacmj6xw-glog-0.4.0
/nix/store/gnfx6w9hn1m01jfagcz8kjfyfx5yr03r-gtest-1.10.0-dev
/nix/store/hwsf923n8cz168brlbqhzk6xdnvq470a-lz4-1.9.3-dev
/nix/store/yi3s56zpfqzifxyvwq2w26qaa2pvdn90-rapidjson-1.1.0
/nix/store/zxcg4nhpr4kgdbddxkvhjialvx3aa207-re2-20201001
/nix/store/6agjbdry3l2lgq2haasihc8vk5crk2bf-snappy-1.1.8-dev
/nix/store/j9jpsbmd32shq02n4gw1b1jfhbcl4r7w-thrift-0.13.0
/nix/store/yhi0gjym17zsfag4w9l69qfx1x8ghrp1-utf8proc-2.6.1
/nix/store/jq1kb7cydz4nixnzd9xv35bg56czg0fb-zlib-1.2.11-dev
/nix/store/jbbkpj0z8mrjpy38vsm0v2fxnvmbd1dc-zstd-1.4.8-dev
/nix/store/nyrgyvvx7nz6ws6xy39wg8yysvgl0wxq-python3-3.8.7
/nix/store/vw7hnwfk5svzwzgvmfxjn88afr17dqwa-python3.8-numpy-1.19.4
            Reporter: Dmitry Kalinkin



{noformat}
pyarrow/tests/test_memory.py:135: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'nonexistent', expected = ['system', 'jemalloc', 'mimalloc']

    def check_env_var(name, expected, *, expect_warning=False):
        code = f"""if 1:
            import pyarrow as pa
    
            pool = pa.default_memory_pool()
            assert pool.backend_name in {expected!r}, pool.backend_name
            """
        env = dict(os.environ)
        env['ARROW_DEFAULT_MEMORY_POOL'] = name
        res = subprocess.run([sys.executable, "-c", code], env=env,
                             universal_newlines=True, stderr=subprocess.PIPE)
        if res.returncode != 0:
            print(res.stderr, file=sys.stderr)
            res.check_returncode()  # fail
        errlines = res.stderr.splitlines()
        if expect_warning:
>           assert len(errlines) == 1
E           assert 2 == 1
E            +  where 2 = len(['WARNING: Logging before InitGoogleLogging() is written to STDERR', "W0127 00:42:32.562058 219203008 memory_pool.cc:1...ackend 'nonexistent' specified in ARROW_DEFAULT_MEMORY_POOL (supported backends are 'jemalloc', 'mimalloc', 'system')"])

pyarrow/tests/test_memory.py:123: AssertionError
{noformat}

The way to see the warning is to execute:
{noformat}
# ARROW_DEFAULT_MEMORY_POOL=foo python3.8 -c "import pyarrow as pa"
WARNING: Logging before InitGoogleLogging() is written to STDERR
W0126 20:03:23.580569 217023936 memory_pool.cc:124] Unsupported backend 'foo' specified in ARROW_DEFAULT_MEMORY_POOL (supported backends are 'jemalloc', 'mimalloc', 'system')
{noformat}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)