Skip to content

[Bugfix] [Tests] Perform explicit garbage collection in between tests #1503

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/llmcompressor/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gc
import os
import shutil
import tempfile
Expand Down Expand Up @@ -80,7 +81,7 @@ def check_for_created_files():


@pytest.fixture(autouse=True, scope="function")
def setup_fresh_session():
def llm_compressor_setup_teardown():
"""
setup any state tied to the execution of the given method in a
class. setup_method is invoked for every test method of a class.
Expand All @@ -92,3 +93,6 @@ def setup_fresh_session():
yield
# reset the session after each test
reset_session()
# explictly collect memory to catch memory bugs,
# see https://github.com/vllm-project/llm-compressor/pull/1503
gc.collect()