Skip to content

Commit 7992250

Browse files
BenGoldbergergithub-actions[bot]
authored andcommitted
[MOD-10076] - remove the FDs check in gc oom test (#6903)
* add wait for gc * remove FDs check * add wait for gc * remove FDs check (cherry picked from commit 44d4914)
1 parent 221e972 commit 7992250

1 file changed

Lines changed: 2 additions & 21 deletions

File tree

tests/pytests/test_gc.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44
from time import sleep
55
import threading
66
import time
7-
import psutil
8-
9-
10-
def get_open_file_count(pid):
11-
"""Get open file count using psutil library"""
12-
try:
13-
p = psutil.Process(pid)
14-
return p.num_fds()
15-
except psutil.NoSuchProcess:
16-
return 0
177

188
@skip(cluster=True)
199
def testBasicGC(env):
@@ -434,20 +424,13 @@ def test_gc_oom(env:Env):
434424
for i in range(num_docs):
435425
env.expect('HSET', f'doc{i}', 't', f'name{i}').equal(1)
436426

437-
# Get open file count
438-
redis_server_pid = env.executeCommand('info')['process_id']
439-
open_files_before_gc = get_open_file_count(redis_server_pid)
440-
env.assertGreater(open_files_before_gc, 0)
441-
442427
set_tight_maxmemory_for_oom(env)
443428

444429
# Delete them all
445430
for i in range(num_docs):
446431
env.expect('DEL', f'doc{i}').equal(1)
447-
forceInvokeGC(env)
448-
# Verify no open file descriptors were left behind
449-
open_files_after_skip_gc = get_open_file_count(redis_server_pid)
450-
env.assertEqual(open_files_before_gc, open_files_after_skip_gc)
432+
433+
forceInvokeGC(env)
451434

452435
# Verify no bytes collected by GC
453436
info = index_info(env)
@@ -465,5 +448,3 @@ def test_gc_oom(env:Env):
465448
bytes_collected = int(gc_dict['bytes_collected'])
466449
env.assertGreater(bytes_collected, 0)
467450

468-
open_files_after_gc = get_open_file_count(redis_server_pid)
469-
env.assertEqual(open_files_before_gc, open_files_after_gc)

0 commit comments

Comments
 (0)