/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
contrib/python/pyrsistent/py3/tests/regression_test.py
30 строк
721 B
Anton Myagkov
Update ydb version to 24.4 (#4579)
07 фев 2026, 11:59
Не верифицирован
07 фев 2026, 11:59
2c21cae
Код
Авторство
О чём код?
from pyrsistent import pmap import random import gc def test_segfault_issue_52(): threshold = None if hasattr(gc, 'get_threshold'): # PyPy is lacking these functions threshold = gc.get_threshold() gc.set_threshold(1, 1, 1) # fail fast v = [pmap()] def step(): depth = random.randint(1, 10) path = random.sample(range(100000), depth) v[0] = v[0].transform(path, "foo") for i in range(1000): # usually crashes after 10-20 steps while True: try: step() break except AttributeError: # evolver on string continue if threshold: gc.set_threshold(*threshold)