Отзывать сессию в кэше до удаления в PostgreSQL
Application / stack (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Pavel Grigorev
2026-10-31 10:25:02 +03:00
parent cd81572950
commit 90a0532809
10 changed files with 131 additions and 41 deletions
+5 -2
View File
@@ -48,10 +48,13 @@ def main():
started = time.monotonic()
other = new_user('nocache')
expect('регистрация и вход без кэша', (200, time.monotonic() - started), [200], 1)
expect('logout без кэша', timed('DELETE', '/api/v1/auth/sessions/current', other['token']), [204], 1)
expect('отозванный токен', timed('GET', '/api/v1/users/me', other['token']), [401], 1)
expect('logout без кэша: отзыв не подтверждён', timed('DELETE', '/api/v1/auth/sessions/current', other['token']), [503], 1.5)
expect('токен после неудачного logout работает', timed('GET', '/api/v1/users/me', other['token']), [200], 1)
finally:
compose('up', '-d', '--wait', 'valkey')
time.sleep(6)
expect('logout после восстановления Valkey', timed('DELETE', '/api/v1/auth/sessions/current', other['token']), [204], 1)
expect('отозванный токен', timed('GET', '/api/v1/users/me', other['token']), [401], 1)
print('2. PostgreSQL остановлен: ограниченная ошибка 503, анонимный запрос не проходит')
compose('stop', 'postgres')