Skip to content

Commit

Permalink
Reduce the shared memory size in the test case to avoid the error
Browse files Browse the repository at this point in the history
Signed-off-by: Gigon Bae <[email protected]>
  • Loading branch information
gigony authored and jakirkham committed Aug 8, 2024
1 parent 177a6c1 commit a9b6042
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/cucim/tests/unit/clara/test_image_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@ def test_get_per_process_cache():
def test_get_shared_memory_cache():
from cucim import CuImage

cache = CuImage.cache("shared_memory", memory_capacity=2048)
cache = CuImage.cache("shared_memory", memory_capacity=128)
assert int(cache.type) == 2
assert cache.memory_size == 0
# It allocates additional memory
assert cache.memory_capacity > 2**20 * 2048
assert cache.free_memory > 2**20 * 2048
assert cache.memory_capacity > 2**20 * 128
assert cache.free_memory > 2**20 * 128
assert cache.size == 0
assert cache.capacity > 0
assert cache.hit_count == 0
assert cache.miss_count == 0

config = cache.config
# Check essential properties
# {'type': 'shared_memory', 'memory_capacity': 2048, 'capacity': 10922,
# 'mutex_pool_capacity': 11117, 'list_padding': 10000,
# {'type': 'shared_memory', 'memory_capacity': 2048, 'capacity': 682,
# 'mutex_pool_capacity': 100003, 'list_padding': 10000,
# 'extra_shared_memory_size': 100, 'record_stat': False}
assert config["type"] == "shared_memory"
assert config["memory_capacity"] == 2048
assert config["memory_capacity"] == 128
assert not config["record_stat"]


Expand Down

0 comments on commit a9b6042

Please sign in to comment.