test: 8 стресс-функций (py/go/js), crash-тесты, stress_test.sh — 32 строки в PG

This commit is contained in:
Naeel
2026-03-19 19:44:26 +03:00
parent d87981713d
commit 014b99ed16
16 changed files with 463 additions and 0 deletions
@@ -0,0 +1,20 @@
# 2026-03-19
# stress_bigloop.py — CPU-интенсивная функция: считает сумму квадратов N чисел.
# Проверяет поведение под нагрузкой (большая и средняя итерация).
import time
_VERSION = "v1"
def run(event):
n = int(event.get("n", 500_000))
start = time.monotonic()
total = sum(i * i for i in range(n))
elapsed = round(time.monotonic() - start, 4)
return {
"version": _VERSION,
"n": n,
"sum_of_squares": total,
"elapsed_sec": elapsed,
}