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

Improve tests #112

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Improve tests #112

merged 3 commits into from
Mar 6, 2024

Commits on Mar 6, 2024

  1. Correctly pass environment variables to tox envs

    I'm not sure if these ever worked, but at least with current versions of
    tox you definitely need to provide a wildcard in order for them to be
    passed along.
    
    Signed-off-by: Matt Wozniski <[email protected]>
    godlygeek committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    4232a6f View commit details
    Browse the repository at this point in the history
  2. Update tox to test with Python 3.12

    We were already doing this explicitly in CI, but this commit updates us
    to run the coverage tests with 3.12 instead of 3.11, and to test 3.12 by
    default when tox is run from the command line.
    
    Signed-off-by: Matt Wozniski <[email protected]>
    godlygeek committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    c67c352 View commit details
    Browse the repository at this point in the history
  3. Fix a flaky test

    When this test was selected to be run with `pytest -k` or `--lf`, it
    would fail because of allocations made by the platform threading
    implementation:
    
        - 8.0MiB allocated here:
            __pthread_create_2_1
            PyThread_start_new_thread
            ...
    
    When it was run as part of the larger test suite, it would pass, because
    the test suite had already started other threads, and paid that cost in
    a place where we weren't looking for leaks.
    
    Since we can't tell pthreads not to cache the pthread_t for later reuse,
    the best we can do here is just raise all of our thresholds for this
    test by a constant factor, so that the ones that are supposed to fail
    will fail with or without an extra 8 MB allocation, and the ones that
    are supposed to pass will pass with or without it as well.
    
    This commit scales all of the sizes and limits used by this test up by
    a factor of 4096 (and drops one of the test vectors, since we don't need
    to leak 400 MB just to prove a point when we already know we fail after
    leaking 40 MB).
    
    Signed-off-by: Matt Wozniski <[email protected]>
    godlygeek committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    14838d8 View commit details
    Browse the repository at this point in the history