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

Relax the sizes in the 'test_limit_memory_marker_with_pytest_xdist' test #83

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

pablogsal
Copy link
Member

When using pytest-xdist there are some extra allocations that the
plugin does that make it quite difficult to test values for the limit
decorator that are close to the numeric limit. In particular this is a
sample list of allocations in Python 3.11 when the plugin is active:

List of allocations:
    - 628.0B allocated here:
        channel_data:/lib/python3.11/site-packages/execnet/gateway_base.py:476
    - 534.0B allocated here:
        _local_receive:/lib/python3.11/site-packages/execnet/gateway_base.py:856
    - 772.0B allocated here:
        handle_command:/lib/python3.11/site-packages/xdist/remote.py:128
    - 1.0KiB allocated here:
        valloc:/lib/python3.11/site-packages/memray/_test.py:44
    - 862.0B allocated here:
        _thread_receiver:/lib/python3.11/site-packages/execnet/gateway_base.py:969

The only one the test cares about is the one made using valloc, but
unlike in the memray test suite we cannot filter them in the tests, so
we need to make the allocation sizes bigger and remove the tests that
are checking exactly in the limit.

When using `pytest-xdist` there are some extra allocations that the
plugin does that make it quite difficult to test values for the `limit`
decorator that are close to the numeric limit. In particular this is a
sample list of allocations in Python 3.11 when the plugin is active:

```
List of allocations:
    - 628.0B allocated here:
        channel_data:/lib/python3.11/site-packages/execnet/gateway_base.py:476
    - 534.0B allocated here:
        _local_receive:/lib/python3.11/site-packages/execnet/gateway_base.py:856
    - 772.0B allocated here:
        handle_command:/lib/python3.11/site-packages/xdist/remote.py:128
    - 1.0KiB allocated here:
        valloc:/lib/python3.11/site-packages/memray/_test.py:44
    - 862.0B allocated here:
        _thread_receiver:/lib/python3.11/site-packages/execnet/gateway_base.py:969
```

The only one the test cares about is the one made using `valloc`, but
unlike in the `memray` test suite we cannot filter them in the tests, so
we need to make the allocation sizes bigger and remove the tests that
are checking exactly in the limit.
@pablogsal pablogsal merged commit 10a354f into bloomberg:main Jun 23, 2023
10 checks passed
@pablogsal pablogsal deleted the xdist branch June 23, 2023 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants