Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python][CI] test_dlpack is failing on some nightly jobs allocating unexpected memory #44728

Closed
raulcd opened this issue Nov 14, 2024 · 3 comments

Comments

@raulcd
Copy link
Member

raulcd commented Nov 14, 2024

Describe the bug, including details regarding any error messages, version, and platform.

Several jobs:

are failing for the test_dlpack test with some variants of:

 ________________________ test_dlpack[value_type6-int32] ________________________

args = (), kwargs = {'np_type_str': 'int32', 'value_type': DataType(int32)}
allocated_bytes = 7440
@py_assert1 = <cyfunction total_allocated_bytes at 0x7fc798db2b70>
@py_assert3 = 3728, @py_assert5 = False
@py_format7 = '3728\n{3728 = <cyfunction total_allocated_bytes at 0x7fc798db2b70>\n{<cyfunction total_allocated_bytes at 0x7fc798db2b70> = pa.total_allocated_bytes\n}()\n} == 7440'
@py_format9 = 'assert 3728\n{3728 = <cyfunction total_allocated_bytes at 0x7fc798db2b70>\n{<cyfunction total_allocated_bytes at 0x7fc798db2b70> = pa.total_allocated_bytes\n}()\n} == 7440'

    @wraps(f)
    def wrapper(*args, **kwargs):
        allocated_bytes = pa.total_allocated_bytes()
        try:
            return f(*args, **kwargs)
        finally:
>           assert pa.total_allocated_bytes() == allocated_bytes
E           assert 3728 == 7440
E            +  where 3728 = <cyfunction total_allocated_bytes at 0x7fc798db2b70>()
E            +    where <cyfunction total_allocated_bytes at 0x7fc798db2b70> = pa.total_allocated_bytes

Component(s)

Continuous Integration, Python

@jorisvandenbossche
Copy link
Member

This started to fail on the main CI as well (eg #44720).

I don't directly see any difference in the conda env between the failing build and the last build on main (which is still green) ..

@raulcd
Copy link
Member Author

raulcd commented Nov 20, 2024

I can't reproduce locally with:

$ PYTHON=3.11 PANDAS=latest NUMPY=latest docker compose build conda-python-pandas
$ PYTHON=3.11 PANDAS=latest NUMPY=latest docker compose run conda-python-pandas

The test is successful:

opt/conda/envs/arrow/lib/python3.11/site-packages/pyarrow/tests/test_dlpack.py ............s
...
7539 passed, 231 skipped, 23 xfailed, 2 xpassed, 15 warnings in 202.04s (0:03:22) 

The only skipped test is the cuda requiring one, the same skipped in CI:

SKIPPED [1] opt/conda/envs/arrow/lib/python3.11/site-packages/pyarrow/tests/test_dlpack.py:133: could not import 'pyarrow.cuda': No module named 'pyarrow._cuda'

raulcd added a commit to raulcd/arrow that referenced this issue Nov 20, 2024
raulcd added a commit that referenced this issue Nov 21, 2024
…allocated bytes for dlpack tests (#44793)

### Rationale for this change

test_dlpack started failing for several jobs on CI due to our tests deallocating memory:
```
        allocated_bytes = pa.total_allocated_bytes()
        try:
            return f(*args, **kwargs)
        finally:
>           assert pa.total_allocated_bytes() == allocated_bytes
E           assert 3728 == 7440
```

### What changes are included in this PR?

Trigger a `gc.collect` before checking initial allocated bytes.

### Are these changes tested?

Yes via CI

### Are there any user-facing changes?

No

* GitHub Issue: #44728

Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
@raulcd raulcd added this to the 19.0.0 milestone Nov 21, 2024
@raulcd
Copy link
Member Author

raulcd commented Nov 21, 2024

Issue resolved by pull request 44793
#44793

@raulcd raulcd closed this as completed Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants