diff options
author | shmel1k <shmel1k@ydb.tech> | 2023-11-26 18:16:14 +0300 |
---|---|---|
committer | shmel1k <shmel1k@ydb.tech> | 2023-11-26 18:43:30 +0300 |
commit | b8cf9e88f4c5c64d9406af533d8948deb050d695 (patch) | |
tree | 218eb61fb3c3b96ec08b4d8cdfef383104a87d63 /contrib/python/pyrsistent/py3/tests/regression_test.py | |
parent | 523f645a83a0ec97a0332dbc3863bb354c92a328 (diff) | |
download | ydb-b8cf9e88f4c5c64d9406af533d8948deb050d695.tar.gz |
add kikimr_configure
Diffstat (limited to 'contrib/python/pyrsistent/py3/tests/regression_test.py')
-rw-r--r-- | contrib/python/pyrsistent/py3/tests/regression_test.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/python/pyrsistent/py3/tests/regression_test.py b/contrib/python/pyrsistent/py3/tests/regression_test.py new file mode 100644 index 0000000000..f8c1133834 --- /dev/null +++ b/contrib/python/pyrsistent/py3/tests/regression_test.py @@ -0,0 +1,30 @@ +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) |