You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ra...@apache.org on 2023/06/29 14:49:37 UTC

[arrow] branch main updated: GH-35728: [CI][Python] Move test_total_bytes_allocated to a subprocess to improve reliability (#36355)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new fa4e27a6a2 GH-35728: [CI][Python] Move test_total_bytes_allocated to a subprocess to improve reliability (#36355)
fa4e27a6a2 is described below

commit fa4e27a6a2b94d8d844074a3cd146c014f60b3e9
Author: Raúl Cumplido <ra...@gmail.com>
AuthorDate: Thu Jun 29 16:49:30 2023 +0200

    GH-35728: [CI][Python] Move test_total_bytes_allocated to a subprocess to improve reliability (#36355)
    
    ### Rationale for this change
    
    Currently some conda and wheels jobs are failing due to this error:
    
    ```
     =================================== FAILURES ===================================
    __________________________ test_total_bytes_allocated __________________________
    
        def test_total_bytes_allocated():
    >       assert pa.total_allocated_bytes() == 0
    E       assert 1216 == 0
    E        +  where 1216 = <built-in function total_allocated_bytes>()
    E        +    where <built-in function total_allocated_bytes> = pa.total_allocated_bytes
    ```
    
    ### What changes are included in this PR?
    
    As suggested on the issue trying to move this test to a subprocess to see if it improves reliabilit.
    
    ### Are these changes tested?
    
    Archery and CI
    
    ### Are there any user-facing changes?
    
    No
    * Closes: #35728
    
    Authored-by: Raúl Cumplido <ra...@gmail.com>
    Signed-off-by: Raúl Cumplido <ra...@gmail.com>
---
 python/pyarrow/tests/test_array.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/python/pyarrow/tests/test_array.py b/python/pyarrow/tests/test_array.py
index 77da6a3ebd..a9e8f09d1b 100644
--- a/python/pyarrow/tests/test_array.py
+++ b/python/pyarrow/tests/test_array.py
@@ -24,6 +24,7 @@ import itertools
 import pickle
 import pytest
 import struct
+import subprocess
 import sys
 import weakref
 
@@ -38,7 +39,17 @@ import pyarrow.tests.strategies as past
 
 
 def test_total_bytes_allocated():
+    code = """if 1:
+    import pyarrow as pa
+
     assert pa.total_allocated_bytes() == 0
+    """
+    res = subprocess.run([sys.executable, "-c", code],
+                         universal_newlines=True, stderr=subprocess.PIPE)
+    if res.returncode != 0:
+        print(res.stderr, file=sys.stderr)
+        res.check_returncode()  # fail
+    assert len(res.stderr.splitlines()) == 0
 
 
 def test_weakref():