Отзывать сессию в кэше до удаления в PostgreSQL
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user