Skip to content

Commit bfc9cdb

Browse files
authored
GH-50037: [Python] test_table_uses_memory_pool flaky on macOS 14 job (#50045)
### Rationale for this change Fixes #50037 ### What changes are included in this PR? Add `gc.collect()` before `prior_allocation = pa.total_allocated_bytes()` in `test_table_uses_memory_pool` and also add to `_check_to_pandas_memory_unchanged` helper with the same pattern. Same fix as #44793 ### Are these changes tested? Not reproduced locally yet. ### Are there any user-facing changes? No. * GitHub Issue: #50037 Authored-by: Tadeja Kadunc <tadeja.kadunc@gmail.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 222bfb7 commit bfc9cdb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

python/pyarrow/tests/test_pandas.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3901,6 +3901,7 @@ def test_singleton_blocks_zero_copy():
39013901

39023902

39033903
def _check_to_pandas_memory_unchanged(obj, **kwargs):
3904+
gc.collect()
39043905
prior_allocation = pa.total_allocated_bytes()
39053906
x = obj.to_pandas(**kwargs) # noqa
39063907

@@ -3966,6 +3967,7 @@ def test_table_uses_memory_pool():
39663967
arr = pa.array(np.arange(N, dtype=np.int64))
39673968
t = pa.table([arr, arr, arr], ['f0', 'f1', 'f2'])
39683969

3970+
gc.collect()
39693971
prior_allocation = pa.total_allocated_bytes()
39703972
x = t.to_pandas()
39713973

0 commit comments

Comments
 (0)