Skip to content

Commit 4b31e2b

Browse files
tmp commit
Signed-off-by: Stepan Bagritsevich <[email protected]>
1 parent 1840490 commit 4b31e2b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/dragonfly/memory_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ async def test_eval_with_oom(df_factory: DflyInstanceFactory):
186186

187187

188188
@pytest.mark.asyncio
189+
@pytest.mark.parametrize("repeat", range(4))
189190
@pytest.mark.parametrize(
190191
"proactor_threads_param, maxmemory_param",
191192
[(1, 6 * (1024**3)), (4, 6 * (1024**3))],
@@ -194,6 +195,7 @@ async def test_cache_eviction_with_rss_deny_oom_simple_case(
194195
df_factory: DflyInstanceFactory,
195196
proactor_threads_param,
196197
maxmemory_param,
198+
repeat,
197199
):
198200
"""
199201
Test to verify that cache eviction is triggered even if used memory is small but rss memory is above limit
@@ -287,12 +289,13 @@ async def test_cache_eviction_with_rss_deny_oom_simple_case(
287289

288290

289291
@pytest.mark.asyncio
292+
@pytest.mark.parametrize("repeat", range(4))
290293
@pytest.mark.parametrize(
291294
"proactor_threads_param, maxmemory_param",
292295
[(1, 6 * (1024**3)), (4, 6 * (1024**3))],
293296
)
294297
async def test_cache_eviction_with_rss_deny_oom_two_waves(
295-
df_factory: DflyInstanceFactory, proactor_threads_param, maxmemory_param
298+
df_factory: DflyInstanceFactory, proactor_threads_param, maxmemory_param, repeat
296299
):
297300
"""
298301
Test to verify that cache eviction is triggered even if used memory is small but rss memory is above limit
@@ -319,10 +322,10 @@ async def test_cache_eviction_with_rss_deny_oom_two_waves(
319322
rss_eviction_threshold = max_memory * (rss_oom_deny_ratio - eviction_memory_budget_threshold)
320323

321324
# first wave fills 85% of max memory
322-
# second wave fills 20% of max memory
325+
# second wave fills 25% of max memory
323326
data_fill_size = [
324327
int((rss_oom_deny_ratio + 0.05) * max_memory),
325-
int((1 - rss_oom_deny_ratio) * max_memory),
328+
int((1 - rss_oom_deny_ratio + 0.05) * max_memory),
326329
]
327330

328331
val_size = 1024 * 5 # 5 kb
@@ -372,7 +375,7 @@ async def test_cache_eviction_with_rss_deny_oom_two_waves(
372375
break
373376

374377
# Wait for some time
375-
await asyncio.sleep(6)
378+
await asyncio.sleep(3)
376379

377380
memory_arena = await async_client.execute_command("MEMORY", "ARENA")
378381
fragmentation_waste = extract_fragmentation_waste(memory_arena)

0 commit comments

Comments
 (0)