Implement lab2 PostgreSQL sessions and Redis cache

This commit is contained in:
Polusikkkk
2026-10-16 18:23:50 +03:00
parent 65003b6119
commit 083dc49564
25 changed files with 2782 additions and 29 deletions
+24
View File
@@ -0,0 +1,24 @@
make test-extra && make test-faults
make[1]: Entering directory '/home/polina/projects/mtusi2026lab2'
BASE_URL="http://localhost:18081" python3 tests/lab2_checks.py
test_chat_creation_rollback (__main__.Lab2Checks.test_chat_creation_rollback) ... ok
test_concurrent_username_registration (__main__.Lab2Checks.test_concurrent_username_registration) ... ok
test_logout (__main__.Lab2Checks.test_logout) ... ok
test_unicode_password_with_colons (__main__.Lab2Checks.test_unicode_password_with_colons) ... ok
test_wrong_password (__main__.Lab2Checks.test_wrong_password) ... ok
test_x_user_id_does_not_authenticate_or_change_user (__main__.Lab2Checks.test_x_user_id_does_not_authenticate_or_change_user) ... ok
----------------------------------------------------------------------
Ran 6 tests in 1.384s
OK
make[1]: Leaving directory '/home/polina/projects/mtusi2026lab2'
make[1]: Entering directory '/home/polina/projects/mtusi2026lab2'
BASE_URL="http://localhost:18081" python3 tests/lab2_faults.py
PASS: Redis outage fallback; authenticated request took 0.140s
PASS: PostgreSQL outage fails closed; authenticated request took 3.006s
PASS: existing session recovered after PostgreSQL restart
PASS: short session expired; observed after 2.067s
RESTORED: services running; SESSION_TTL_SECONDS=3600
PASS: dependency outages and short session expiry
make[1]: Leaving directory '/home/polina/projects/mtusi2026lab2'