Skip to content

Commit dcf6dcb

Browse files
committed
test(rtc): exit cleanly in ctypes array garbage test to avoid SIGABRT on Linux
1 parent 6601c38 commit dcf6dcb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎livekit-rtc/tests/test_ffi_client.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@
2222
_COUNT_ARRAY_TYPES_IN_GARBAGE = """
2323
import ctypes
2424
import gc
25+
import os
26+
import sys
2527
2628
from livekit import rtc
2729
2830
gc.collect()
2931
gc.set_debug(gc.DEBUG_SAVEALL)
30-
for _ in range(50):
32+
for _ in range(10):
3133
rtc.AudioProcessingModule()
3234
gc.collect()
33-
print(sum(isinstance(o, type(ctypes.Array)) for o in gc.garbage))
35+
count = sum(isinstance(o, type(ctypes.Array)) for o in gc.garbage)
36+
sys.stdout.write(f"{count}\\n")
37+
sys.stdout.flush()
38+
os._exit(0)
3439
"""
3540

3641

0 commit comments

Comments
 (0)