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

Make Memory-Related Tests Less Fragile #121978

Open
ericsnowcurrently opened this issue Jul 18, 2024 · 0 comments
Open

Make Memory-Related Tests Less Fragile #121978

ericsnowcurrently opened this issue Jul 18, 2024 · 0 comments
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@ericsnowcurrently
Copy link
Member

ericsnowcurrently commented Jul 18, 2024

Feature or enhancement

Proposal:

There are a number of tests that check various aspects of memory management, typically related to some specific module or feature. Nearly every one of these tests is fairly tightly coupled to the fine details of our memory management implementation, usually tied to specific numbers.

This makes the tests fragile, often breaking with even slight changes to some aspect of memory management. 1

For example, in #121134 (comment), @Fidget-Spinner says:

It fails

    test.test_gdb.test_pretty_print test_capi test_exceptions
    test_regrtest test_repl test_sys test_tracemalloc

mainly because they count allocations/test out of memory situations, and the hashtable adds random allocations which breaks their careful calculations.

2

Ideally, we would find a way to make such tests less coupled to specific numbers, without sacrificing the accuracy of the behavior checks they are making.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Footnotes

  1. To be fair, we don't make changes to memory management very often; clearly these tests aren't breaking all the time.

  2. Note that those aren't necessarily the only tests that need attention here.

@ericsnowcurrently ericsnowcurrently added type-feature A feature request or enhancement tests Tests in the Lib/test dir labels Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant