Добавить X-Instance-Id, задержку drain при SIGTERM и отдельный запуск миграций
This commit is contained in:
@@ -146,11 +146,14 @@ func TestLogoutRevokesOnlyTheCurrentToken(t *testing.T) {
|
||||
ts.expect(ts.do(http.MethodGet, "/api/v1/users/me", other.Token, nil, nil), http.StatusOK, "")
|
||||
}
|
||||
|
||||
// The TTL leaves room for a loaded machine: with one second the first request
|
||||
// after login sometimes arrived too late under -race with all packages
|
||||
// running at once.
|
||||
func TestSessionExpiresAfterTTL(t *testing.T) {
|
||||
ts := newTesterWithTTL(t, time.Second)
|
||||
ts := newTesterWithTTL(t, 3*time.Second)
|
||||
alice := ts.user("alice", "A")
|
||||
ts.expect(ts.do(http.MethodGet, "/api/v1/users/me", alice.token, nil, nil), http.StatusOK, "")
|
||||
time.Sleep(1200 * time.Millisecond)
|
||||
time.Sleep(3200 * time.Millisecond)
|
||||
ts.expect(ts.do(http.MethodGet, "/api/v1/users/me", alice.token, nil, nil), http.StatusUnauthorized, "unauthorized")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user