-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable data cache in unit tests (#4174)
- Loading branch information
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (C) 2025 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
from __future__ import annotations | ||
|
||
import pytest | ||
from otx.core.data.mem_cache import MemCacheHandlerSingleton | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def fxt_disable_mem_cache(): | ||
"""Disable mem cache to reduce memory usage.""" | ||
|
||
original_mem_limit = MemCacheHandlerSingleton.CPU_MEM_LIMITS_GIB | ||
MemCacheHandlerSingleton.CPU_MEM_LIMITS_GIB = 99999999 | ||
yield | ||
MemCacheHandlerSingleton.CPU_MEM_LIMITS_GIB = original_mem_limit |