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

Set lower CPU usage for test_shared_process_pool.py to avoid slowing down the test #1935

Merged
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
4 changes: 4 additions & 0 deletions tests/utils/test_shared_process_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import logging
import multiprocessing as mp
import os
import threading
from decimal import Decimal
from fractions import Fraction
Expand All @@ -31,6 +32,8 @@

@pytest.fixture(scope="session", autouse=True)
def setup_and_teardown():
# Set lower CPU usage for unit test to avoid slowing down the test
os.environ["MORPHEUS_SHARED_PROCESS_POOL_CPU_USAGE"] = "0.1"

pool = SharedProcessPool()

Expand All @@ -43,6 +46,7 @@ def setup_and_teardown():
# Stop the pool after all tests are done
pool.stop()
pool.join()
os.environ.pop("MORPHEUS_SHARED_PROCESS_POOL_CPU_USAGE", None)


@pytest.fixture(name="shared_process_pool")
Expand Down
Loading