Skip to content

Commit 0806a80

Browse files
committed
GH-35728: [CI][Python] Move test_total_bytes_allocated to a subprocess to improve reliability
1 parent 0344a2c commit 0806a80

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

python/pyarrow/tests/test_array.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import pickle
2525
import pytest
2626
import struct
27+
import subprocess
2728
import sys
2829
import weakref
2930

@@ -38,7 +39,17 @@
3839

3940

4041
def test_total_bytes_allocated():
42+
code = f"""if 1:
43+
import pyarrow as pa
44+
4145
assert pa.total_allocated_bytes() == 0
46+
"""
47+
res = subprocess.run([sys.executable, "-c", code],
48+
universal_newlines=True, stderr=subprocess.PIPE)
49+
if res.returncode != 0:
50+
print(res.stderr, file=sys.stderr)
51+
res.check_returncode() # fail
52+
assert len(res.stderr.splitlines()) == 0
4253

4354

4455
def test_weakref():

0 commit comments

Comments
 (0)